Skip to content

Commit

Permalink
Dev: using normalized class selector for all submit buttons in AjaxMode
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Jul 30, 2018
1 parent cec8015 commit 4258a83
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions application/models/TemplateConfig.php
Expand Up @@ -536,9 +536,9 @@ public function getClassAndAttributes()
$aClassAndAttributes['class']['quotamessage'] = ' quotamessage limesurveycore ';
$aClassAndAttributes['class']['navigator'] = ' navigator ';
$aClassAndAttributes['class']['navigatorcoll'] = ' ';
$aClassAndAttributes['class']['navigatorcollbutton'] = ' ls-move-btn ls-move-previous-btn ';
$aClassAndAttributes['class']['navigatorcollbutton'] = ' ls-move-btn ls-move-previous-btn action--ls-button-previous';
$aClassAndAttributes['class']['navigatorcolr'] = ' ';
$aClassAndAttributes['class']['navigatorcolrbutton'] = ' ls-move-btn ls-move-submit-btn ';
$aClassAndAttributes['class']['navigatorcolrbutton'] = ' ls-move-btn ls-move-submit-btn action--ls-button-submit';
$aClassAndAttributes['class']['completedquotaurl'] = ' url-wrapper url-wrapper-survey-quotaurl ';
$aClassAndAttributes['class']['completedquotaurla'] = ' ls-endurl ls-quotaurl ';
$aClassAndAttributes['class']['completedquotaurla'] = ' ls-endurl ls-quotaurl ';
Expand Down Expand Up @@ -756,10 +756,10 @@ public function getClassAndAttributes()

$aClassAndAttributes['class']['navigatorcontainer'] = ' ';
$aClassAndAttributes['class']['navigatorbuttonl'] = ' ';
$aClassAndAttributes['class']['navigatorbuttonprev'] = ' ls-move-btn ls-move-previous-btn ';
$aClassAndAttributes['class']['navigatorbuttonprev'] = ' ls-move-btn ls-move-previous-btn action--ls-button-previous';
$aClassAndAttributes['class']['navigatorbuttonr'] = ' ';
$aClassAndAttributes['class']['navigatorbuttonsubmit'] = ' ls-move-btn ls-move-submit-btn ';
$aClassAndAttributes['class']['navigatorbuttonnext'] = ' ls-move-btn ls-move-next-btn ls-move-submit-btn ';
$aClassAndAttributes['class']['navigatorbuttonsubmit'] = ' ls-move-btn ls-move-submit-btn action--ls-button-submit ';
$aClassAndAttributes['class']['navigatorbuttonnext'] = ' ls-move-btn ls-move-next-btn ls-move-submit-btn action--ls-button-submit ';
$aClassAndAttributes['class']['loadsavecontainer'] = ' ';
$aClassAndAttributes['class']['loadsaveccol'] = ' save-clearall-wrapper ';
$aClassAndAttributes['class']['loadbutton'] = ' ls-saveaction ls-loadall ';
Expand Down
@@ -1,7 +1,7 @@
<?php
if ($screenname != 'welcome')
{
echo App()->getController()->renderPartial("/survey/system/actionButton/movePrevious",array('value'=>"moveprev",'class'=>"ls-move-btn ls-move-previous-btn"),true);
echo App()->getController()->renderPartial("/survey/system/actionButton/movePrevious",array('value'=>"moveprev",'class'=>"ls-move-btn ls-move-previous-btn action--ls-button-previous"),true);
}
echo App()->getController()->renderPartial("/survey/system/actionButton/moveNext",array('value'=>"movenext",'class'=>"ls-move-btn ls-move-next-btn"),true);
echo App()->getController()->renderPartial("/survey/system/actionButton/moveNext",array('value'=>"movenext",'class'=>"ls-move-btn ls-move-next-btn action--ls-button-submit"),true);
?>
2 changes: 1 addition & 1 deletion assets/scripts/navigator-countdown.js
Expand Up @@ -27,7 +27,7 @@ function navigator_countdown(n)

function navigator_countdown_btn()
{
return $('.ls-move-btn');
return $('.action--ls-button-submit');
}

function navigator_countdown_end()
Expand Down
2 changes: 1 addition & 1 deletion assets/scripts/timer.js
Expand Up @@ -242,7 +242,7 @@ var TimerConstructor = function(options){
* redirect to the next page
*/
_redirectOut = function(){
$('.ls-move-btn').trigger('click');
$('.action--ls-button-submit').trigger('click');
},
/**
* Binds the reset of the localStorage as soon as the participant has submitted the form
Expand Down
2 changes: 1 addition & 1 deletion themes/survey/vanilla/scripts/ajaxify.js
Expand Up @@ -111,7 +111,7 @@ var AjaxSubmitObject = function () {
// Restrict to [type=submit]:not([data-confirmedby])
// - :submit is the default if button don't have type (reset button on slider for example),
// - confirmedby have their own javascript system
$(document).on('click', '#ls-button-submit, #ls-button-previous', function (e) {
$(document).on('click', '.action--ls-button-submit, .action--ls-button-previous', function (e) {
$('#limesurvey').append('<input id="onsubmitbuttoninput" name=\'' + $(this).attr('name') + '\' value=\'' + $(this).attr('value') + '\' type=\'hidden\' />');
if (isIE10 || /Edge\/\d+\.\d+/.test(navigator.userAgent)) {
e.preventDefault();
Expand Down
4 changes: 2 additions & 2 deletions themes/survey/vanilla/scripts/theme.js
Expand Up @@ -240,7 +240,7 @@ var ThemeScripts = function(){
}
$(this).closest('.question-container').next('.question-container').find('input, textarea').first().focus();
} else if (code==13 && e.ctrlKey == true) {
$('.ls-move-btn').trigger('click');
$('.action--ls-button-submit').trigger('click');
}
};

Expand All @@ -256,7 +256,7 @@ var ThemeScripts = function(){
}
$(this).closest('.question-container').next('.question-container').find('input, textarea').first().focus();
} else if (code==13 && e.ctrlKey == true) {
$('.ls-move-btn').trigger('click');
$('.action--ls-button-submit').trigger('click');
}
};

Expand Down

0 comments on commit 4258a83

Please sign in to comment.