[BUGFIX] RTE: Determine window object correctly 53/49353/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 3 Aug 2016 15:32:14 +0000 (17:32 +0200)
committerBenni Mack <benni@typo3.org>
Wed, 3 Aug 2016 16:19:12 +0000 (18:19 +0200)
Resolves: #77385
Releases: master
Change-Id: I203ec542ca0534e87da0730dfcad130b3c1dfdd9
Reviewed-on: https://review.typo3.org/49353
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/HTMLArea/Plugin/Plugin.js
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/RteLinkBrowser.js

index 0dcffb6..dd6ea1e 100644 (file)
@@ -435,17 +435,13 @@ define([
                 * @param {String} url The url to load ino the iframe
                 */
                openContainerWindow: function (buttonId, title, height, url) {
-                       var self = this,
-                               $iframe = $('<iframe />', {src: url, 'class': 'content-iframe', style: 'border: 0; height: ' + height * 1 + 'px;'}),
+                       var $iframe = $('<iframe />', {src: url, 'class': 'content-iframe', style: 'border: 0; height: ' + height * 1 + 'px;'}),
                                $content = $('<div />', {'class': 'htmlarea-window', id: this.editor.editorId + buttonId}).append($iframe);
 
                        this.dialog = Modal.show(this.localize(title) || title, $content, Severity.notice);
 
                        // TODO: dirty CSS hack - provide an API instead?
                        this.dialog.find('.modal-body').css('padding', 0);
-                       this.dialog.on('modal-dismiss', function() {
-                               self.onCancel();
-                       });
                },
 
                /**
index b43c6eb..4a45181 100644 (file)
@@ -66,8 +66,14 @@ define(['jquery', 'TYPO3/CMS/Recordlist/LinkBrowser'], function($, LinkBrowser)
         *
         */
        RteLinkBrowser.initialize = function() {
-               RteLinkBrowser.plugin = window.parent.RTEarea[LinkBrowser.urlParameters.editorNo].editor.getPlugin("TYPO3Link");
-               RteLinkBrowser.HTMLArea = window.parent.HTMLArea;
+               var callerWindow;
+               if (typeof top.TYPO3.Backend !== 'undefined' && typeof top.TYPO3.Backend.ContentContainer.iframe !== 'undefined') {
+                       callerWindow = top.TYPO3.Backend.ContentContainer.iframe;
+               } else {
+                       callerWindow = window.parent;
+               }
+               RteLinkBrowser.plugin = callerWindow.RTEarea[LinkBrowser.urlParameters.editorNo].editor.getPlugin("TYPO3Link");
+               RteLinkBrowser.HTMLArea = callerWindow.HTMLArea;
 
                $.extend(RteLinkBrowser, $('body').data());