]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Refs #4970 prevent Firefox from adding files to TinyMCE editor
authorcash <cash.costello@gmail.com>
Tue, 19 Feb 2013 15:46:23 +0000 (10:46 -0500)
committercash <cash.costello@gmail.com>
Tue, 19 Feb 2013 15:46:23 +0000 (10:46 -0500)
mod/tinymce/views/default/js/tinymce.php

index b4db43cee475ad84c5a7cf2af24919b02d634dbf..344d71b1478748605d09ac1f1f6b46fac0e0056c 100644 (file)
@@ -66,6 +66,18 @@ elgg.tinymce.init = function() {
                                var text = elgg.echo('tinymce:word_count') + strip.split(' ').length + ' ';
                                tinymce.DOM.setHTML(tinymce.DOM.get(tinyMCE.activeEditor.id + '_path_row'), text);
                        });
+
+                       ed.onInit.add(function(ed) {
+                               // prevent Firefox from dragging/dropping files into editor
+                               if (tinymce.isGecko) {
+                                       tinymce.dom.Event.add(ed.getBody().parentNode, "drop", function(e) {
+                                               if (e.dataTransfer.files.length > 0) {
+                                                       e.preventDefault();
+                                               }
+                                       });
+                               }
+                       });
+
                },
                content_css: elgg.config.wwwroot + 'mod/tinymce/css/elgg_tinymce.css'
        });