meilisearch/Resources/Public/JavaScript/FormModal.js
2021-04-17 00:26:33 +02:00

34 lines
1.0 KiB
JavaScript

define([
'jquery',
'TYPO3/CMS/Backend/Modal'
], function($, Modal) {
$(document).ready(function() {
$('.t3js-modal-formsubmit-trigger').click(function(){
var element = $(this);
var title = element.data('title');
var content = element.data('content');
var severity = (typeof top.TYPO3.Severity[element.data('severity')] !== 'undefined') ? top.TYPO3.Severity[element.data('severity')] : top.TYPO3.Severity.info;
Modal.confirm(title, content, severity, [
{
text: 'Confirm',
active: true,
trigger: function() {
element.parents('form:first').submit();
Modal.dismiss();
}
}, {
text: 'Abort!',
trigger: function() {
Modal.dismiss();
}
}
]);
return false;
})
});
});