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:
Brian Federle 2014-11-17 15:12:19 -08:00
parent e712ac78d0
commit bfe53d1b2b

View File

@ -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