demo/public/js/larabb.js
2023-03-23 18:50:47 +01:00

38 lines
836 B
JavaScript

var delay = (function(){
var timer = 0;
return function(callback, ms){
clearTimeout (timer);
timer = setTimeout(callback, ms);
};
})();
$(function () { $('[data-bs-toggle="tooltip"]').tooltip() });
$('.alert.alert-success.auto-hide').delay(3000).slideUp();
if(typeof bootbox !== 'undefined') {
bootbox.addLocale('pp', {
OK : 'OK',
CANCEL : 'Abbrechen',
CONFIRM : 'Bestätigen'
});
bootbox.setLocale('pp');
$('form.delete').on('submit', function($event) {
$event.preventDefault();
let $form = $(this);
bootbox.confirm({
'size' : 'large',
'message' : $form.data('message'),
'callback' : function($result) {
if($result) $form.off('submit').submit();
}
});
});
}