Skip to content

Commit

Permalink
Fixed issue #14788: resume later + ajax mode : JS issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ptelu committed May 3, 2019
1 parent 370586e commit 770cd2d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -260,7 +260,7 @@ public function run($surveyid, $args)
$this->aSurveyInfo['upload_file'] = $upload_file;
$hiddenfieldnames = $this->aSurveyInfo['hiddenfieldnames'] = implode("|", $inputnames);

Yii::app()->clientScript->registerScriptFile(Yii::app()->getConfig("generalscripts").'nojs.js', CClientScript::POS_HEAD);
App()->clientScript->registerScriptFile(App()->getConfig("generalscripts").'nojs.js', CClientScript::POS_BEGIN);

// Show question code/number
$this->aSurveyInfo['aShow'] = $this->getShowNumAndCode();
Expand Down
10 changes: 5 additions & 5 deletions assets/packages/template-core/template-core.js
Expand Up @@ -11,9 +11,9 @@ var TemplateCoreClass = function () {
*/
/* showStartPopups : replace core function : allow HTML and use it. Unusuable with ajax */
showStartPopups: function () {
if (LSvar.showpopup && LSvar.startPopups.length) {
startPopups = LSvar.startPopups.map(function (text) {
return "<p>"+text+"<p>";
if (LSvar.showpopup && $.isArray(LSvar.startPopups)) {
startPopups = LSvar.startPopups.map( function (text) {
return "<p>"+text+"</p>";
});
window.templateCore.alertSurveyDialog(startPopups.join(""));
}
Expand All @@ -24,9 +24,9 @@ var TemplateCoreClass = function () {
*/
alertSurveyDialog: function (startPopups, title) {
text = "";
if (LSvar.showpopup && startPopups.length) {
if (LSvar.showpopup && $.isArray(startPopups)) {
startPopups = startPopups.map(function (text) {
return "<p>"+text+"<p>";
return "<p>"+text+"</p>";
});
text = startPopups.join("");
}
Expand Down
4 changes: 3 additions & 1 deletion assets/scripts/nojs.js
@@ -1,4 +1,6 @@
/**
* no-js/js class by external file : see https://bugs.limesurvey.org/view.php?id=11945
*/
(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement);
(function (H) {
H.className = H.className.replace(/\bno-js\b/, 'js');
})(document.documentElement);

0 comments on commit 770cd2d

Please sign in to comment.