src/aria/popups/PopupManager.js
function (target, notifyTargetBehindModalPopup) {
                var searchPopup = this._document && target !== this._document.body;
                if (searchPopup) {
                    for (var i = this.openedPopups.length - 1; i >= 0; i--) {
                        var popup = this.openedPopups[i];
                        if (utilsDom.isAncestor(target, popup.getDomElement())) {
                            // the element is in the modal popup, it is fine to focus it
                            return popup;
                        }
                        if (popup.modalMaskDomElement && utilsDom.isAncestor(target, popup.popupContainer.getContainerElt())) {
                            // the element is inside the container for which there is a modal mask
                            if (notifyTargetBehindModalPopup) {
                                return notifyTargetBehindModalPopup(popup);
                            }
                            return;
                        }
                    }
                }
            }
function (target, notifyTargetBehindModalPopup) {
                var searchPopup = this._document && target !== this._document.body;
                if (searchPopup) {
                    for (var i = this.openedPopups.length - 1; i >= 0; i--) {
                        var popup = this.openedPopups[i];
                        if (utilsDom.isAncestor(target, popup.getDomElement())) {
                            // the element is in the modal popup, it is fine to focus it
                            return popup;
                        }
                        if (popup.modalMaskDomElement && utilsDom.isAncestor(target, popup.popupContainer.getContainerElt())) {
                            // the element is inside the container for which there is a modal mask
                            if (notifyTargetBehindModalPopup) {
                                return notifyTargetBehindModalPopup(popup);
                            }
                            return;
                        }
                    }
                }
            }
function ( target , notifyTargetBehindModalPopup ) { var searchPopup = this . _document && target !== this . _document . body ; if ( searchPopup ) { for ( var i = this . openedPopups . length - 1 ; i >= 0 ; i -- ) { var popup = this . openedPopups [ i ] ; if ( utilsDom . isAncestor ( target , popup . getDomElement ( ) ) ) { // the element is in the modal popup, it is fine to focus it return popup ; } if ( popup . modalMaskDomElement && utilsDom . isAncestor ( target , popup . popupContainer . getContainerElt ( ) ) ) { // the element is inside the container for which there is a modal mask if ( notifyTargetBehindModalPopup ) { return notifyTargetBehindModalPopup ( popup ) ; } return ; } } } }
Returns the popup which contains the given target DOM element, if the DOM element is not hidden
behind a modal popup.
@param {HTMLElement} target DOM element for which the containing popup has to be found
@param {Function} notifyTargetBehindModalPopup function which is called in case the target is behind
a modal popup. The function receives the modal popup as a parameter and its return value becomes
the return value of findParentPopup.
Returns the popup which contains the given target DOM element if the DOM element is not hidden behind a modal popup .