Firefox seems to fool JavaScript, block all drop-events
authorAlexander Ebert <ebert@woltlab.com>
Wed, 30 Oct 2013 20:42:28 +0000 (21:42 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 30 Oct 2013 20:42:28 +0000 (21:42 +0100)
wcfsetup/install/files/js/3rdParty/ckeditor/plugins/wbbcode/plugin.js

index 73ed36022cc98038262cf16c16a2542e666a4070..b8934d1644e81fc4717ba7b485cb691227b59eed 100644 (file)
                }, null, null, 9);
                
                // prevent drag and drop of images in Firefox
-               event.editor.document.on('drop', function(ev) {
-                       if (ev.data.$.dataTransfer) {
-                               var $html = ev.data.$.dataTransfer.getData('text/html');
-                               if (/<img src="data:image\/[a-zA-Z0-9]+;base64/.exec($html)) {
-                                       ev.data.preventDefault(true);
-                               }
-                       }
-               });
+               if ($.browser.mozilla) {
+                       event.editor.document.on('drop', function(ev) {
+                               ev.data.preventDefault(true);
+                       });
+               }
                
                event.editor.on('insertText', function(ev) {
                        $insertedText = ev.data;