From fb46275ea2261805e3b09f0ecc2673fab696eccf Mon Sep 17 00:00:00 2001 From: juanmont Date: Mon, 16 Apr 2018 17:13:25 +0200 Subject: [PATCH] B #1960: Introduced the possibility to select empty value for persistent attribute (#1971) --- .../images-tab/form-panels/create-common.js | 7 +++++-- .../images-tab/form-panels/create/wizard.hbs | 18 ++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/sunstone/public/app/tabs/images-tab/form-panels/create-common.js b/src/sunstone/public/app/tabs/images-tab/form-panels/create-common.js index 928381fbce..fbf7d38024 100644 --- a/src/sunstone/public/app/tabs/images-tab/form-panels/create-common.js +++ b/src/sunstone/public/app/tabs/images-tab/form-panels/create-common.js @@ -170,7 +170,7 @@ define(function(require) { if (e["PERSISTENT_ONLY"] != undefined && e["PERSISTENT_ONLY"].toLowerCase() == "yes") { $('#img_persistent', context).prop('disabled', true); - $('#img_persistent', context).prop('checked', true); + $('#img_persistent', context).val("YES"); pers_forced = true; return false; } @@ -395,7 +395,10 @@ define(function(require) { var type = WizardFields.retrieveInput($('#img_type', context)); img_json["TYPE"] = type; - img_json["PERSISTENT"] = $('#img_persistent:checked', context).length ? "YES" : "NO"; + img_json["PERSISTENT"] = $('#img_persistent', context).val(); + if ( img_json["PERSISTENT"] == "" ){ + delete img_json["PERSISTENT"] + } var dev_prefix = WizardFields.retrieveInput($('#img_dev_prefix', context)); if (dev_prefix != undefined && dev_prefix.length) { diff --git a/src/sunstone/public/app/tabs/images-tab/form-panels/create/wizard.hbs b/src/sunstone/public/app/tabs/images-tab/form-panels/create/wizard.hbs index f68ba9ac6f..ada1f491a6 100644 --- a/src/sunstone/public/app/tabs/images-tab/form-panels/create/wizard.hbs +++ b/src/sunstone/public/app/tabs/images-tab/form-panels/create/wizard.hbs @@ -57,10 +57,20 @@ {{#isTabActionEnabled "images-tab" "Image.persistent"}}
- - +
+
+ +
+
+ +
+
{{/isTabActionEnabled}}