From bfe53d1b2b32525f2adaa08b0d70d92a709e6545 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Mon, 17 Nov 2014 15:12:19 -0800 Subject: [PATCH] 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 }); --- ui/scripts/ui-custom/instanceWizard.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js index 527dc105474..e8f0c45b20b 100644 --- a/ui/scripts/ui-custom/instanceWizard.js +++ b/ui/scripts/ui-custom/instanceWizard.js @@ -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