Skip to content
Permalink
Browse files

Make sure buttons stay enabled when html5 validation fails

  • Loading branch information...
flack committed Mar 17, 2019
1 parent ea28707 commit 892b1bfc284f591d38fd74fe8f3cd38afed7e250
Showing with 12 additions and 2 deletions.
  1. +12 −2 static/midcom.workflow/workflow.js
@@ -146,8 +146,18 @@ $(document).ready(function() {
.dialog(options);
});
$('body').on('click', '.midcom-workflow-dialog .ui-dialog-buttonpane .ui-button', function() {
$(this).closest('.ui-dialog-buttonpane').find('.ui-button')
.addClass('ui-state-disabled');
var pane = $(this).closest('.ui-dialog-buttonpane'),
iframe = pane.prevAll('#midcom-dialog').find('iframe'),
disabler = function() {
pane.find('.ui-button')
.addClass('ui-state-disabled');
};

if (!$(this).hasClass('dialog-extra-button') && $('form.datamanager2', iframe.contents()).length > 0) {
$('form.datamanager2', iframe.contents()).on('submit', disabler);
} else {
disabler();
}
});
});

0 comments on commit 892b1bf

Please sign in to comment.
You can’t perform that action at this time.