CLOUDSTACK-2864: Fix duplicate message on affinity group Fixes issue where text on affinity group step of instance wizard is duplicated, when going back a step and making changes.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/59e65e84 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/59e65e84 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/59e65e84 Branch: refs/heads/master Commit: 59e65e8406873b9d5a851519948e4007fb7c1577 Parents: d51fa1c Author: Brian Federle <[email protected]> Authored: Fri Jul 12 12:04:57 2013 -0700 Committer: Brian Federle <[email protected]> Committed: Fri Jul 12 12:05:10 2013 -0700 ---------------------------------------------------------------------- ui/scripts/ui-custom/instanceWizard.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/59e65e84/ui/scripts/ui-custom/instanceWizard.js ---------------------------------------------------------------------- diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js index ea7acf8..31b4baa 100644 --- a/ui/scripts/ui-custom/instanceWizard.js +++ b/ui/scripts/ui-custom/instanceWizard.js @@ -489,7 +489,10 @@ 'affinity': function($step, formData) { return { response: { - success: function(args) { + success: function(args) { + // Cleanup + $step.find('.main-desc, p.no-affinity-groups').remove(); + if (args.data.affinityGroups && args.data.affinityGroups.length) { $step.prepend( $('<div>').addClass('main-desc').append( @@ -513,7 +516,9 @@ ) ); } else { - $step.find('.select-container').append($('<p>').html(_l('message.no.affinity.groups'))); + $step.find('.select-container').append( + $('<p>').addClass('no-affinity-groups').html(_l('message.no.affinity.groups')) + ); } } }
