From 4b2eb18cfc82093640b2cb6c47c0378e69b9f8a2 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 14 Jun 2013 14:17:50 -0700 Subject: [PATCH] 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. --- ui/scripts/configuration.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js index cb15598d5b8..cadde8c91a7 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')); + } });