From 4e569f85ebfb378bad8009bbaa86776e94cd1af2 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 20 Jan 2015 16:58:04 -0800 Subject: [PATCH] volume-upload: UI > upload template from local > fix a bug that fields below OS Type field (isPublic, isFeatured, ~ ) are not created. --- ui/scripts/templates.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index 5c2f495f6c1..14b8c39f66f 100644 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -856,20 +856,18 @@ osTypeId: { label: 'label.os.type', docID: 'helpRegisterTemplateOSType', - select: function(args) { - if (ostypeObjs == undefined) { - $.ajax({ - url: createURL("listOsTypes"), - dataType: "json", - async: false, - success: function(json) { - ostypeObjs = json.listostypesresponse.ostype; - } - }); - } - args.response.success({ - data: ostypeObjs - }); + select: function(args) { + $.ajax({ + url: createURL("listOsTypes"), + dataType: "json", + async: true, + success: function(json) { + var ostypeObjs = json.listostypesresponse.ostype; + args.response.success({ + data: ostypeObjs + }); + } + }); } },