replaced delete confirm dialog with modal (#638)

This commit is contained in:
Kevin Papst
2019-03-12 23:24:22 +01:00
committed by GitHub
parent 46655ad462
commit f4d53e9006
43 changed files with 303 additions and 109 deletions

View File

@@ -44,19 +44,12 @@ $(function() {
// auto hide success message after x seconds, as they are just meant as quick feedback and
// not as a permanent source of information
if ($.kimai.settings['alertSuccessAutoHide'] > 0) {
setTimeout(
function() {
$('div.alert-success').alert('close');
},
$.kimai.settings['alertSuccessAutoHide']
);
}
// ask before a delete call is executed
$('body').on('click', 'a.btn-trash', function (event) {
return confirm($.kimai.settings['confirmDelete']);
});
setTimeout(
function() {
$('div.alert-success').alert('close');
},
5000
);
// compound field in toolbar
this.activateDateRangePicker('.content-wrapper');
@@ -107,6 +100,7 @@ $(function() {
});
},
reloadDatatableWithToolbarFilter: function() {
// TODO check if toolbar form is present, if not, reload current URL
var $form = $('.toolbar form');
var loading = '<div class="overlay"><i class="fas fa-sync fa-spin"></i></div>';
$('section.content').append(loading);
@@ -230,6 +224,8 @@ $(function() {
// load new form from given content
if ($(html).find('#form_modal .modal-content').length > 0 ) {
// switch classes, in case the modal type changed
$('#remote_form_modal').attr('class', $(html).find('#form_modal').attr('class'));
// TODO cleanup widgets before replacing the content?
$('#remote_form_modal .modal-content').replaceWith(
$(html).find('#form_modal .modal-content')
@@ -312,8 +308,6 @@ $(function() {
// default values
$.kimai.defaults = {
locale: 'en',
alertSuccessAutoHide: 5000,
confirmDelete: 'Really delete?',
today: 'Today',
yesterday: 'Yesterday',
apply: 'Apply',