wrapper function for localization pulldown menu to work as trigger

function for notifications
This commit is contained in:
DennisSchiefer 2012-07-04 17:25:04 +01:00
parent 770f3b5979
commit 22783a53cd

View File

@ -42,12 +42,15 @@ init: function() {
}
// generate selectors
OSRM.GUI.selectorInit("gui-language-toggle", options, selected, OSRM.Localization.setLanguage);
OSRM.GUI.selectorInit("gui-language-2-toggle", options_2, selected, OSRM.Localization.setLanguage);
OSRM.GUI.selectorInit("gui-language-toggle", options, selected, OSRM.Localization.setLanguageWrapper);
OSRM.GUI.selectorInit("gui-language-2-toggle", options_2, selected, OSRM.Localization.setLanguageWrapper);
// set default language
OSRM.Localization.setLanguage( OSRM.DEFAULTS.LANGUAGE );
},
setLanguageWrapper: function(language) {
OSRM.Localization.setLanguage(language);
},
setLanguage: function(language) {
// change value of both language selectors
OSRM.GUI.selectorChange( document.getElementById('gui-language-toggle'), language );