Skip to content

Commit

Permalink
[BUGFIX] Access parent element in Element Browser correctly
Browse files Browse the repository at this point in the history
When the element browser is opened in a popup window, the parent element
(=popup) is now accessed properly.

This patch also fixes the case for `list_frame` which didn't work in
Firefox.

Resolves: #83693
Releases: master
Change-Id: I2436942a239b868cd1e3e269c6161a9df92e05ff
Reviewed-on: https://review.typo3.org/55511
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: Mathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
andreaskienast authored and lolli42 committed Feb 4, 2018
1 parent 6b7c038 commit 7b0e70f
Showing 1 changed file with 12 additions and 8 deletions.
Expand Up @@ -87,23 +87,27 @@ define([
if (
typeof window.parent !== 'undefined' &&
typeof window.parent.document.list_frame !== 'undefined' &&
window.parent.document.activeElement.classList.contains('t3js-modal-iframe')
window.parent.document.list_frame.parent.document.querySelector('.t3js-modal-iframe') !== null
) {
opener = window.parent.document.list_frame;
}
else if (
} else if (
typeof window.parent !== 'undefined' &&
typeof window.parent.frames.list_frame !== 'undefined' &&
window.parent.frames.list_frame.parent.document.querySelector('.t3js-modal-iframe') !== null
) {
opener = window.parent.frames.list_frame;
} else if (
typeof window.frames !== 'undefined' &&
typeof window.frames.frameElement !== 'undefined' &&
window.frames.frameElement !== null &&
window.frames.frameElement.classList.contains('t3js-modal-iframe')
) {
opener = window.frames.parent.frames.list_frame;
}
else if (window.opener) {
opener = window.opener
opener = window.frames.frameElement.contentWindow.parent;
} else if (window.opener) {
opener = window.opener;
}
return opener;
}
};

/**
*
Expand Down

0 comments on commit 7b0e70f

Please sign in to comment.