Merge pull request #1362 from gabsource/fix-sweetalert
Disable SweetAlert forced focus when a Bootstrap modal is already open in back-end
This commit is contained in:
commit
9ebd084e89
|
|
@ -386,7 +386,13 @@
|
|||
function handleOnBlur(e) {
|
||||
var $targetElement = e.target || e.srcElement,
|
||||
$focusElement = e.relatedTarget,
|
||||
modalIsVisible = hasClass(modal, 'visible');
|
||||
modalIsVisible = hasClass(modal, 'visible'),
|
||||
bootstrapModalIsVisible = document.querySelector('.control-popup.modal') || false;
|
||||
|
||||
if(bootstrapModalIsVisible) {
|
||||
// Bootstrap will enforce focus on the existing model, so don't do anything here to prevent infinite loop
|
||||
return;
|
||||
}
|
||||
|
||||
if (modalIsVisible) {
|
||||
var btnIndex = -1; // Find the button - note, this is a nodelist, not an array.
|
||||
|
|
|
|||
Loading…
Reference in New Issue