Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed issue #14553: The countdown does not work most of the time
  • Loading branch information
dominikvitt committed Mar 4, 2019
1 parent 6a2ce58 commit b2a23d2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion application/helpers/frontend_helper.php
Expand Up @@ -1449,7 +1449,7 @@ function getNavigatorDatas()
if ($thissurvey['navigationdelay'] > 0 && ($iSessionMaxStep !== false && $iSessionMaxStep == $iSessionStep)) {
$aNavigator['disabled'] = " disabled";
App()->getClientScript()->registerScriptFile(Yii::app()->getConfig('generalscripts')."/navigator-countdown.js");
App()->getClientScript()->registerScript('navigator_countdown', "navigator_countdown(".$thissurvey['navigationdelay'].");\n", CClientScript::POS_BEGIN);
App()->getClientScript()->registerScript('navigator_countdown', "navigator_countdown(".$thissurvey['navigationdelay'].");\n", LSYii_ClientScript::POS_POSTSCRIPT);
}

// Previous ?
Expand Down
17 changes: 7 additions & 10 deletions assets/scripts/navigator-countdown.js
Expand Up @@ -13,16 +13,13 @@

function navigator_countdown(n)
{
$(document).on('ready pjax:scriptcomplete',function()
{
$('button.disabled').prop("disabled", true);// Double check : already in navbuttonsJqueryUi
$(window).data('countdown', n);
navigator_countdown_btn().each(function(i, e)
{
$(e).data('text', $(e).text());
});
navigator_countdown_int();
});
$('button.disabled').prop("disabled", true);// Double check : already in navbuttonsJqueryUi
$(window).data('countdown', n);
navigator_countdown_btn().each(function(i, e)
{
$(e).data('text', $(e).text());
});
navigator_countdown_int();
}

function navigator_countdown_btn()
Expand Down

0 comments on commit b2a23d2

Please sign in to comment.