Skip to content

Commit

Permalink
FIX Validation error behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
hitaishi19 committed Dec 9, 2024
1 parent 4d864c0 commit afb98b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions client/src/legacy/LeftAndMain.js
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ $.entwine('ss', function($) {
'<span class="btn__circle btn__circle--1"></span>' +
'<span class="btn__circle btn__circle--2"></span>' +
'<span class="btn__circle btn__circle--3"></span>' +
"</div>"
'</div>'
)
);

Expand All @@ -488,6 +488,14 @@ $.entwine('ss', function($) {
};
form.trigger('beforesubmitform', beforeSubmitFormEventData);

var clearButton = function() {
$(button).removeClass('btn--loading loading');
$(button).prop('disabled', false);
$(button).find('.btn__loading-icon').remove();
$(button).css('width', 'auto');
$(button).text($(button).data('original-text'));
}

Promise.all(beforeSubmitFormEventData.promises).then(function(results) {

let success = true;
Expand Down Expand Up @@ -526,14 +534,6 @@ $.entwine('ss', function($) {
// validate if required
var validationResult = form.validate();

var clearButton = function() {
$(button).removeClass('btn--loading loading');
$(button).prop('disabled', false);
$(button).find('.btn__loading-icon').remove();
$(button).css('width', 'auto');
$(button).text($(button).data('original-text'));
}

if(typeof validationResult!=='undefined' && !validationResult) {
statusMessage("Validation failed.", "bad");
clearButton();
Expand Down

0 comments on commit afb98b1

Please sign in to comment.