Skip to content

Commit

Permalink
Fixed issue #13110: Language changer doesn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Jan 17, 2018
1 parent 10699e8 commit 6911202
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions assets/packages/limesurvey/survey.js
Expand Up @@ -150,7 +150,10 @@ function activateLanguageChanger(){
.attr('name', 'lang')
.val(newLang)
.appendTo(limesurveyForm);
// Append move type.
$('<input type="hidden" name="move" value="changelang" />').appendTo(limesurveyForm);
limesurveyForm.submit();
// TODO: Check all code below. When does it happen?
} else {
// If there are no form : we can't use it */
if($(this).data('targeturl')){
Expand Down
7 changes: 4 additions & 3 deletions themes/survey/vanilla/scripts/theme.js
Expand Up @@ -98,12 +98,13 @@ var ThemeScripts = function(){
});
}

/*
var initLanguageChanger = function(selectorItem, selectorGlobalForm){
$(selectorItem).on('change',function() {
var lang = $(this).val();
logObject.log(lang, 'changed');
// If there are no form : we can't use it */
/* No form, not targeturl : just see what happen */
// If there are no form : we can't use it
// No form, not targeturl : just see what happen
var target = window.location.href;
$("<form>", {
"class":'ls-js-hidden',
Expand All @@ -113,6 +114,7 @@ var ThemeScripts = function(){
}).appendTo('body').submit();
});
};
*/

var initTopMenuLanguageChanger = function(selectorItem, selectorGlobalForm){
// $(selectorContainer).height($('#main-row').height());
Expand Down Expand Up @@ -219,7 +221,6 @@ var ThemeScripts = function(){
fixBodyPadding : fixBodyPadding,
hideQuestionWithRelevanceSubQuestion : window.templateCore.hideQuestionWithRelevanceSubQuestion,
hideEmptyPart : hideEmptyPart,
initLanguageChanger: initLanguageChanger,
initTopMenuLanguageChanger: initTopMenuLanguageChanger,
log: logObject
}
Expand Down

0 comments on commit 6911202

Please sign in to comment.