Skip to content

Commit

Permalink
Dev: fixed issue : unable to change language in token form
Browse files Browse the repository at this point in the history
  • Loading branch information
Shnoulle committed Nov 16, 2013
1 parent 4cf6640 commit 21b681c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion application/helpers/frontend_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions scripts/survey_runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion templates/citronade/startpage.pstpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
9 changes: 7 additions & 2 deletions templates/citronade/template.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;}

Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 21b681c

Please sign in to comment.