A simple check to see if it actually changes makes the OPAC load correctly with Dojo 1.6
Signed-off-by: James Fournie <jfournie@sitka.bclibraries.ca>
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');
+ }
}
);
});
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');
+ }
}
);
});