From 437346252a2ff854dece4e5b60904f20c3c2f927 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Tue, 3 Apr 2012 17:14:07 +0200 Subject: [PATCH] Bug #1195: Tentative fix. Seems to fix some weirdness regarding language changes in Sunstone which might be related to session being rebuilt on page reload. (cherry picked from commit e86a32ddc4b55313a6c4c5403550fd5900539396) --- src/sunstone/public/js/locale.js | 8 ++++++-- src/sunstone/public/js/sunstone-util.js | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/sunstone/public/js/locale.js b/src/sunstone/public/js/locale.js index b3a43d4c0e..a029ff8d34 100644 --- a/src/sunstone/public/js/locale.js +++ b/src/sunstone/public/js/locale.js @@ -58,10 +58,14 @@ function setLang(lang_str){ id: uid, extra_param: template_str }, - error: onError + error: onError, + success: function() { + $.post('config',JSON.stringify({lang:lang_tmp}),function(){ + window.location.href = "."; + }); + }, }; OpenNebula.User.update(obj); - $.post('config',JSON.stringify({lang:lang_tmp}),function(){window.location.href = "."}); }; diff --git a/src/sunstone/public/js/sunstone-util.js b/src/sunstone/public/js/sunstone-util.js index 7877635b51..39fae61534 100644 --- a/src/sunstone/public/js/sunstone-util.js +++ b/src/sunstone/public/js/sunstone-util.js @@ -747,6 +747,9 @@ function setupTemplateUpdateDialog(){ return false; }; + //Workaround so deletion of templates is allowed. + if (!new_template) new_template=" "; + var resource = $(this).val(); Sunstone.runAction(resource+".update",id,new_template); dialog.dialog('close');