From 11b40d44ffcbe82d5499d7cc3d796edef18b1fe6 Mon Sep 17 00:00:00 2001 From: Niklas Forsdahl Date: Mon, 3 Sep 2012 10:16:41 +0300 Subject: [PATCH] BUG: locale dropdown sometimes hidden after panel reload The locale dropdown was sometimes hidden after a panel reload via ajax, due to the caching behaviour for the panel. This was caused by the fact that the dropdown was hidden at the point in which the panel was cached (probably due to chosen). Fixed by always making sure the dropdown is shown on its onmatch function. --- javascript/CMSMain.Translatable.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/javascript/CMSMain.Translatable.js b/javascript/CMSMain.Translatable.js index bffd15a..727f357 100755 --- a/javascript/CMSMain.Translatable.js +++ b/javascript/CMSMain.Translatable.js @@ -30,6 +30,11 @@ * whenever a new value is selected, reload the whole CMS in the new locale */ $('.CMSMain #Form_LangForm :input[name=Locale]').entwine({ + onmatch: function() { + // make sure this element is shown, since it might be hidden by chosen before the panel is cached + $(this).show(); + this._super(); + }, onchange: function(e) { var url = $.path.addSearchParams( document.location.href.replace(/locale=[^&]*/, ''),