Fix LanguageSelector saving issue
@@ -48,12 +48,14 @@ AjaxFranceLabs.LanguageSelectorWidget = AjaxFranceLabs.AbstractWidget.extend({
// It's an anonymous function: in this way it's not called when the widget initializes.
$(this.elm).find('select').change(function() {
- // Save user language in the 'lang' table of Cassandra
- $.post('./applyLang',{"lang":$(this).val()});
+ var selectedLang = $(this).val();
+ // Save user language in the 'lang' table of Cassandra
+ $.post('./applyLang',{"lang":selectedLang}, function() {
// Function executed every time the user changes the language of
// Datafari
- window.i18n.userSelected($(this).val());
+ window.i18n.userSelected(selectedLang);
+ });
});
}
});
