CLOUDSTACK-2981: UI - create network offering - fix a bug that provider dropdown always bounced back to the first enabled option. It should only bounce back to the first enabled option when the selected option is disabled.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/4b2eb18c Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/4b2eb18c Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/4b2eb18c Branch: refs/heads/object_store Commit: 4b2eb18cfc82093640b2cb6c47c0378e69b9f8a2 Parents: 3eeca55 Author: Jessica Wang <[email protected]> Authored: Fri Jun 14 14:17:50 2013 -0700 Committer: Jessica Wang <[email protected]> Committed: Fri Jun 14 14:20:58 2013 -0700 ---------------------------------------------------------------------- ui/scripts/configuration.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/4b2eb18c/ui/scripts/configuration.js ---------------------------------------------------------------------- diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js index cb15598..cadde8c 100644 --- a/ui/scripts/configuration.js +++ b/ui/scripts/configuration.js @@ -1228,8 +1228,11 @@ } }); } - $providers.each(function() { - $(this).val($(this).find('option:first')); + $providers.each(function() { + //if selected option is disabled, select the first enabled option instead + if($(this).find('option:selected:disabled').length > 0) { + $(this).val($(this).find('option:first')); + } });
