Fixed bug #16343: htmlArea RTE: JS-Error when closing "Insert Picture" dialogue
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 18 Nov 2010 23:21:03 +0000 (23:21 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 18 Nov 2010 23:21:03 +0000 (23:21 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9490 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js
typo3/sysext/rtehtmlarea/mod4/class.tx_rtehtmlarea_select_image.php

index 9fec681..18be478 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-11-18  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #16343: htmlArea RTE: JS-Error when closing "Insert Picture" dialogue
+
 2010-11-18  Ernesto Baschny  <ernesto@typo3.org>
 
        * Release of TYPO3 4.5.0beta1
index 1e154e7..0ba4b59 100644 (file)
@@ -1,6 +1,10 @@
+2010-11-18  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #16343: htmlArea RTE: JS-Error when closing "Insert Picture" dialogue
+
 2010-11-17  Stanislas Rolland  <typo3@sjbr.ca>
 
-       * Fixed bug #16447: htmlArea RTE: Missing tooltip label for horizontal rule 
+       * Fixed bug #16447: htmlArea RTE: Missing tooltip label for horizontal rule
 
 2010-11-16  Stanislas Rolland  <typo3@sjbr.ca>
 
index 2dd8d79..5b735c3 100644 (file)
@@ -1243,7 +1243,10 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
                this.mon(Ext.get(this.document.documentElement), (Ext.isIE || Ext.isWebKit) ? 'keydown' : 'keypress', this.onAnyKey, this);
                this.mon(Ext.get(this.document.documentElement), 'mouseup', this.onMouse, this);
                this.mon(Ext.get(this.document.documentElement), 'click', this.onMouse, this);
-               this.mon(Ext.get(this.document.documentElement), Ext.isWebKit ? 'dragend' : 'drop', this.onDrop, this);
+               this.mon(Ext.get(this.document.documentElement), 'drop', this.onDrop, this);
+               if (Ext.isWebKit) {
+                       this.mon(Ext.get(this.document.body), 'dragend', this.onDrop, this);
+               }
        },
        /*
         * Handler for other key events
index 7d29995..4c79281 100644 (file)
@@ -261,7 +261,7 @@ class tx_rtehtmlarea_select_image extends browse_links {
         * @return      string          the body tag additions
         */
        public function getBodyTagAdditions() {
-               return '';
+               return 'onload="initEventListeners();"';
        }
 
        /**
@@ -449,9 +449,10 @@ class tx_rtehtmlarea_select_image extends browse_links {
                $JScode='
                        var plugin = window.parent.RTEarea["' . $editorNo . '"].editor.getPlugin("TYPO3Image");
                        var HTMLArea = window.parent.HTMLArea;
-                       var Ext = window.parent.Ext;
-                       if (Ext.isWebKit) {
-                               plugin.dialog.mon(Ext.get(plugin.dialog.getComponent("content-iframe").getEl().dom.contentWindow.document.documentElement), "dragend", plugin.onDrop, plugin, {single: true});
+                       function initEventListeners() {
+                               if (Ext.isWebKit) {
+                                       Ext.EventManager.addListener(window.document.body, "dragend", plugin.onDrop, plugin, { single: true });
+                               }
                        }
                        function jumpToUrl(URL,anchor)  {
                                var add_act = URL.indexOf("act=")==-1 ? "&act='.$act.'" : "";