From: James Fournie Date: Mon, 24 Oct 2011 20:30:30 +0000 (-0700) Subject: Locale selector, for whatever reason, continually calls onChange in Dojo 1.6 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e67a53cce7a94fd057b58429268135b5b095d7f7;p=working%2FEvergreen.git Locale selector, for whatever reason, continually calls onChange in Dojo 1.6 A simple check to see if it actually changes makes the OPAC load correctly with Dojo 1.6 Signed-off-by: James Fournie --- diff --git a/Open-ILS/web/opac/skin/default/xml/common/fonts.xml b/Open-ILS/web/opac/skin/default/xml/common/fonts.xml index c7ebef3801..d03c69d7f0 100644 --- a/Open-ILS/web/opac/skin/default/xml/common/fonts.xml +++ b/Open-ILS/web/opac/skin/default/xml/common/fonts.xml @@ -14,7 +14,10 @@ opacLocaleSelector.setValue(locale); dojo.connect(opacLocaleSelector, 'onChange', function () { - location.href = location.href.replace(/opac\/[^\/]+\/skin/, 'opac/' + this.getValue() + '/skin'); + var locale = location.href.replace( /.+opac\/([^\/]+)\/skin.+/, '$1' ); + if(this.getValue() != locale){ + location.href = location.href.replace(/opac\/[^\/]+\/skin/, 'opac/' + this.getValue() + '/skin'); + } } ); }); diff --git a/Open-ILS/web/opac/skin/default/xml/home/homesearch.xml b/Open-ILS/web/opac/skin/default/xml/home/homesearch.xml index 30ca9a3481..cb1c74ac7b 100644 --- a/Open-ILS/web/opac/skin/default/xml/home/homesearch.xml +++ b/Open-ILS/web/opac/skin/default/xml/home/homesearch.xml @@ -115,7 +115,10 @@ opacLocaleSelector.setValue(locale); dojo.connect(opacLocaleSelector, 'onChange', function () { - location.href = location.href.replace(/opac\/[^\/]+\/skin/, 'opac/' + this.getValue() + '/skin'); + var locale = location.href.replace( /.+opac\/([^\/]+)\/skin.+/, '$1' ); + if(this.getValue() != locale){ + location.href = location.href.replace(/opac\/[^\/]+\/skin/, 'opac/' + this.getValue() + '/skin'); + } } ); });