fix for firefox datepicker focus problem in modals (#630)

This commit is contained in:
Kevin Papst
2019-03-08 01:16:10 +01:00
committed by GitHub
parent 54cd30c564
commit 76c3c5f2f6
3 changed files with 14 additions and 4 deletions

View File

@@ -116,8 +116,7 @@ $(function() {
$(this).find('a.anchor').hide();
});
},
reloadDatatableWithToolbarFilter: function()
{
reloadDatatableWithToolbarFilter: function() {
var $form = $('.toolbar form');
var loading = '<div class="overlay"><i class="fas fa-sync fa-spin"></i></div>';
$('section.content').append(loading);
@@ -256,6 +255,17 @@ $(function() {
);
}
// -----------------------------------------------------------------------
// a fix for firefox focus problems with datepicker in modal
// see https://github.com/kevinpapst/kimai2/issues/618
var enforceModalFocusFn = $.fn.modal.Constructor.prototype.enforceFocus;
$.fn.modal.Constructor.prototype.enforceFocus = function() {};
$modal.on('hidden', function() {
$.fn.modal.Constructor.prototype.enforceFocus = enforceModalFocusFn;
});
$modal.modal({ backdrop : false });
// -----------------------------------------------------------------------
$modal.modal('show');
// the new form that was loaded via ajax