@@ -97,8 +97,7 @@ function afterLoadInstanceJSP() {
9797 $doTemplateNo = $ ( "#vm_popup_disk_offering_template_no" ) ;
9898 $doTemplateCustom = $ ( "#vm_popup_disk_offering_template_custom" ) ;
9999 $doTemplateExisting = $ ( "#vm_popup_disk_offering_template_existing" ) ;
100- $soTemplate = $ ( "#vm_popup_service_offering_template" ) ;
101- vmPopulateDropdown ( ) ;
100+ $soTemplate = $ ( "#vm_popup_service_offering_template" ) ;
102101 init = true ;
103102 }
104103
@@ -126,12 +125,14 @@ function afterLoadInstanceJSP() {
126125 async : false ,
127126 success : function ( json ) {
128127 types = json . listostypesresponse . ostype ;
129- var osTypeDropdownEdit = $ ( "#right_panel_content" ) . find ( "#tab_content_details" ) . find ( "#ostypename_edit" ) . empty ( ) ;
128+ var osTypeDropdown1 = $ ( "#right_panel_content" ) . find ( "#tab_content_details" ) . find ( "#ostypename_edit" ) . empty ( ) ;
129+ var osTypeDropdown2 = $ ( "#dialog_create_template #create_template_os_type" ) . empty ( ) ;
130130 if ( types != null && types . length > 0 ) {
131131 for ( var i = 0 ; i < types . length ; i ++ ) {
132132 osTypeMap [ types [ i ] . id ] = fromdb ( types [ i ] . description ) ;
133- var html = "<option value='" + types [ i ] . id + "'>" + fromdb ( types [ i ] . description ) + "</option>" ;
134- osTypeDropdownEdit . append ( html ) ;
133+ var html = "<option value='" + types [ i ] . id + "'>" + fromdb ( types [ i ] . description ) + "</option>" ;
134+ osTypeDropdown1 . append ( html ) ;
135+ osTypeDropdown2 . append ( html ) ;
135136 }
136137 }
137138 }
@@ -325,22 +326,6 @@ function bindDestroyVMButton() {
325326 return false ;
326327 } ) ;
327328}
328-
329- function vmPopulateDropdown ( ) {
330- $ . ajax ( {
331- data : createURL ( "command=listOsTypes&response=json" ) ,
332- dataType : "json" ,
333- success : function ( json ) {
334- types = json . listostypesresponse . ostype ;
335- if ( types != null && types . length > 0 ) {
336- var select = $ ( "#dialog_create_template #create_template_os_type" ) . empty ( ) ;
337- for ( var i = 0 ; i < types . length ; i ++ ) {
338- select . append ( "<option value='" + types [ i ] . id + "'>" + types [ i ] . description + "</option>" ) ;
339- }
340- }
341- }
342- } ) ;
343- }
344329
345330var currentPageInTemplateGridInVmPopup = 1 ;
346331var selectedTemplateTypeInVmPopup ; //selectedTemplateTypeInVmPopup will be set to "featured" when new VM dialog box opens
0 commit comments