[BUGFIX] RTE: Image drag&drop with WebKit still using ExtJS event 41/36641/2
authorStanislas Rolland <typo3@sjbr.ca>
Tue, 3 Feb 2015 23:31:50 +0000 (18:31 -0500)
committerStanislas Rolland <typo3@sjbr.ca>
Tue, 3 Feb 2015 23:36:52 +0000 (00:36 +0100)
Migrate it to jQuery.

Releases: master
Resolves: #64838
Change-Id: I182c694b5e531b19aef11500319367a3481885f6
Reviewed-on: http://review.typo3.org/36641
Reviewed-by: Stanislas Rolland <typo3@sjbr.ca>
Tested-by: Stanislas Rolland <typo3@sjbr.ca>
typo3/sysext/rtehtmlarea/Classes/SelectImage.php
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/Plugins/TYPO3Image.js

index d8c1fe5..8e69370 100644 (file)
@@ -308,9 +308,11 @@ class SelectImage extends \TYPO3\CMS\Recordlist\Browser\ElementBrowser {
                                return jumpToUrl(' . GeneralUtility::quoteJSvalue($this->getThisScript() . 'editorNo=') . ' + \'' . $editorNo . '\' + \'&insertImage=\' + filePath + \'&table=\' + table + \'&uid=\' + uid + \'&type=\' + type + \'bparams=\' + \'' . $this->bparams . '\');
                        }
                        function initEventListeners() {
-                               if (Ext.isWebKit) {
-                                       Ext.EventManager.addListener(window.document.body, "dragend", plugin.onDrop, plugin, { single: true });
-                               }
+                               require(["TYPO3/CMS/Rtehtmlarea/HTMLArea/UserAgent/UserAgent", "TYPO3/CMS/Rtehtmlarea/HTMLArea/Event/Event"], function (UserAgent, Event) {
+                                       if (UserAgent.isWebKit) {
+                                               Event.one(window.document.body, "dragend", function (event) { plugin.onDrop(event); });
+                                       }
+                               });
                        }
                        function jumpToUrl(URL,anchor) {
                                var add_act = URL.indexOf("act=")==-1 ? "&act=' . $act . '" : "";
index 790dcfc..6b007dd 100644 (file)
@@ -116,7 +116,7 @@ define('TYPO3/CMS/Rtehtmlarea/Plugins/TYPO3Image',
                 */
                onDrop: function (event) {
                        if (UserAgent.isWebKit) {
-                               this.editor.iframe.onDrop();
+                               this.editor.iframe.onDrop(event);
                        }
                        this.close();
                        return true;