From ff9210f95ea5b214685cf393bd60ea277292ab93 Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Fri, 13 Sep 2013 16:47:08 +0200 Subject: [PATCH] Bug #2315: Uncheck context on update if context doesn't exist As a bonus, set memory default on VM template create --- src/sunstone/public/js/plugins/templates-tab.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index e821ee3d76..c71688438f 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -4588,6 +4588,9 @@ function fillTemplatePopUp(request, response){ var context = template.CONTEXT; var context_section = $('li#contextTab', $create_template_dialog); + $("#ssh_context", context_section).removeAttr('checked'); + $("#network_context", context_section).removeAttr('checked'); + if (context) { var file_ds_regexp = /\$FILE\[IMAGE_ID=([0-9]+)+/g; var net_regexp = /^NETWORK$/;; @@ -4598,8 +4601,6 @@ function fillTemplatePopUp(request, response){ var net_flag = false; var files = []; - $("#ssh_context", context_section).removeAttr('checked'); - $("#network_context", context_section).removeAttr('checked'); $.each(context, function(key, value){ if (ssh_regexp.test(key)) { $("#ssh_context", context_section).attr('checked','checked');