mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
VM wizard: Add 'showStep' event
For UI plugin development, allow moving though VM wizard steps via
custom event hook, cloudStack.instanceWizard.showStep (attached to
wizard DOM object), passing the specified target step index
Example:
$wizard.trigger('cloudStack.instanceWizard.showStep', {
index: 2 // Show step 2 of wizard
refresh: true // (Optional) Force refresh of step if data loaded
});
This commit is contained in:
parent
e712ac78d0
commit
bfe53d1b2b
@ -1004,6 +1004,10 @@
|
||||
}
|
||||
};
|
||||
|
||||
$wizard.bind('cloudStack.instanceWizard.showStep', function(e, args) {
|
||||
showStep(args.index, { refresh: true });
|
||||
});
|
||||
|
||||
// Go to specified step in wizard,
|
||||
// updating nav items and diagram
|
||||
var showStep = function(index, options) {
|
||||
@ -1020,6 +1024,10 @@
|
||||
var stepID = $targetStep.attr('wizard-step-id');
|
||||
var formData = cloudStack.serializeForm($form);
|
||||
|
||||
if (options.refresh) {
|
||||
$targetStep.removeClass('loaded');
|
||||
}
|
||||
|
||||
if (!$targetStep.hasClass('loaded')) {
|
||||
// Remove previous content
|
||||
if (!$targetStep.hasClass('review')) { // Review row content is not autogenerated
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user