hide success notification after 5 seconds #169 (#170)

This commit is contained in:
Kevin Papst
2018-06-21 18:47:13 +02:00
committed by GitHub
parent 3dc054b839
commit 0eaa81578a
3 changed files with 24 additions and 11 deletions

View File

@@ -34,8 +34,20 @@ $(function() {
return confirm($.kimai.settings['confirmDelete']);
});
// activate the dropdown functionality
$('.dropdown-toggle').dropdown();
// 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']
);
}
$('input[data-datepicker="on"]').daterangepicker({
singleDatePicker: true,
showDropdowns: true,
@@ -88,7 +100,8 @@ $(function() {
$.kimai.defaults = {
baseUrl: '/',
imagePath: '/images',
confirmDelete: 'Really delete?'
confirmDelete: 'Really delete?',
alertSuccessAutoHide: 5000
};
// once initialized, here are all values