diff --git a/application/helpers/frontend_helper.php b/application/helpers/frontend_helper.php index 5963dc094b4..1b14b0cfe02 100644 --- a/application/helpers/frontend_helper.php +++ b/application/helpers/frontend_helper.php @@ -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 diff --git a/scripts/survey_runtime.js b/scripts/survey_runtime.js index 3bb428b2c3a..00963da3d63 100644 --- a/scripts/survey_runtime.js +++ b/scripts/survey_runtime.js @@ -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). + $('
', { + "html": '', + "action": document.location.href + }).appendTo(document.body).submit(); }else{ $('#changelangbtn').click(); } diff --git a/templates/citronade/startpage.pstpl b/templates/citronade/startpage.pstpl index eb55cbdcb05..e21853321a0 100644 --- a/templates/citronade/startpage.pstpl +++ b/templates/citronade/startpage.pstpl @@ -20,7 +20,7 @@

{SURVEYNAME}

diff --git a/templates/citronade/template.css b/templates/citronade/template.css index 8c5cd2b0f5e..242765a9aad 100644 --- a/templates/citronade/template.css +++ b/templates/citronade/template.css @@ -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 */