Browse Source

#2079 - Make sure element is in DOM when determining close event

pull/2102/head
jlukic 10 years ago
parent
commit
a50b1ea116
1 changed files with 6 additions and 1 deletions
  1. 7
      src/definitions/modules/modal.js

7
src/definitions/modules/modal.js

@ -228,7 +228,12 @@ $.fn.modal = function(parameters) {
} }
}, },
click: function(event) { click: function(event) {
if( $(event.target).closest($module).length === 0 ) {
var
$target = $(event.target),
isInModal = ($target.closest($module).length === 0),
isInDOM = $.contains(document.documentElement, event.target)
;
if(isInModal && isInDOM) {
module.debug('Dimmer clicked, hiding all modals'); module.debug('Dimmer clicked, hiding all modals');
if( module.is.active() ) { if( module.is.active() ) {
module.remove.clickaway(); module.remove.clickaway();

Loading…
Cancel
Save