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.

This commit is contained in:
Jessica Wang 2013-06-14 14:17:50 -07:00
parent 3eeca55c76
commit 4b2eb18cfc

View File

@ -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'));
}
});