Commit 21b681cd authored by Chenu Denis's avatar Chenu Denis

Dev: fixed issue : unable to change language in token form

parent 4cf6640e
......@@ -258,7 +258,7 @@ function makeLanguageChangerSurvey($sSelectedLanguage)
}
$sHTMLCode=CHtml::dropDownList('lang', $sSelected,$aListLang,array('class'=>$sClass));
// We don't have to add this button if in previewmode
$sHTMLCode.= CHtml::htmlButton($clang->gT("Change the language"),array('type'=>'submit','id'=>"changelangbtn",'value'=>'changelang','name'=>'changelang','class'=>'changelang jshide hide'));
$sHTMLCode.= CHtml::htmlButton($clang->gT("Change the language"),array('type'=>'submit','id'=>"changelangbtn",'value'=>'changelang','name'=>'changelang','class'=>'changelang jshide'));
return $sHTMLCode;
}
else
......
......@@ -241,8 +241,11 @@ function showStartPopups(){
*/
function activateLanguageChanger(){
$(document).on('change','select.languagechanger', function() {
if($(this).hasClass('getparam')){
document.location.href=$(this).find('option:selected').val();
if(!$(this).closest('form').length){// If there are no form : we can't use it, we need to create and submit. This break no-js compatibility in some page (token for example).
$('<form>', {
"html": '<input type="hidden" name="lang" value="' + $(this).find('option:selected').val() + '" />',
"action": document.location.href
}).appendTo(document.body).submit();
}else{
$('#changelangbtn').click();
}
......
......@@ -20,7 +20,7 @@
<div id="head">
<div class="wrapper">
<!--<a href="#" title="Made with LimeSurvey" id="link-logo"><img src="{TEMPLATEURL}logo.png" alt=" " id="logo"/></a>-->
<div class="tools">{LANGUAGECHANGER}</div><h1 id="sitename">{SITENAME}</h1>
<h1 id="sitename">{SITENAME}</h1>
</div>
</div>
<div id="title"><h2 id="surveytitle" class="wrapper">{SURVEYNAME}</h2></div>
......
......@@ -56,8 +56,10 @@ input, button, select {vertical-align: middle;}
#progressbar,#progress-pre,#progress-post{display:none}
#progress-wrapper .hide{position:relative;top:0;left:0;}
}
.no-js #progressbar,.no-js #progress-pre,.no-js #progress-post{display:none}
.no-js #progress-wrapper .hide{position:relative;top:0;left:0;}
/* Hide some element if javascript is not activated */
.no-js input.saveall,.no-js input.clearall,.no-js #moveprevbtn{display:none}
/*.no-js input.saveall,.no-js input.clearall,.no-js #moveprevbtn{display:none}*/
.no-js .slider_showmin,.no-js .slider_showmax{display:none;}
.no-js .slider_lefttext,.no-js .slider_righttext{display:none;}
......@@ -224,7 +226,10 @@ table.question tbody tr:hover {background:#D5DBE7}
#head img#logo{vertical-align:middle;}
#head a#link-logo:hover,#head a#link-logo:focus,#head a#link-logo:active{background:transparent;}
#head a#link-logo {outline: 0;} /* remove the outline on logo click */
#languagechanger {margin:0.5em;}
.languagechanger {margin:0.5em;}
.js .changelang{display:none}
.no-js .languagechanger,.no-js .changelang{display:none}
.no-js form .languagechanger,.no-js form .changelang{display:inline;display:inline-block;}
#languageselect-wrapper{float:right;margin:0.5em;}
.js #languageselect-wrapper{margin-top:-1em;}
/* survey list */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment