Skip to content

Commit bfe53d1

Browse files
committed
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 });
1 parent e712ac7 commit bfe53d1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎ui/scripts/ui-custom/instanceWizard.js‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,10 @@
10041004
}
10051005
};
10061006

1007+
$wizard.bind('cloudStack.instanceWizard.showStep', function(e, args) {
1008+
showStep(args.index, { refresh: true });
1009+
});
1010+
10071011
// Go to specified step in wizard,
10081012
// updating nav items and diagram
10091013
var showStep = function(index, options) {
@@ -1020,6 +1024,10 @@
10201024
var stepID = $targetStep.attr('wizard-step-id');
10211025
var formData = cloudStack.serializeForm($form);
10221026

1027+
if (options.refresh) {
1028+
$targetStep.removeClass('loaded');
1029+
}
1030+
10231031
if (!$targetStep.hasClass('loaded')) {
10241032
// Remove previous content
10251033
if (!$targetStep.hasClass('review')) { // Review row content is not autogenerated

0 commit comments

Comments
 (0)