aboutsummaryrefslogtreecommitdiff
path: root/mod/tinymce
diff options
context:
space:
mode:
authorSteve Clay <steve@mrclay.org>2013-03-12 19:40:41 -0700
committerSteve Clay <steve@mrclay.org>2013-03-12 19:40:41 -0700
commita7b63dd21dbc6aa9e7509878dab6734e118ac198 (patch)
tree508dec2b2b693049554475fef7b312806329fc9e /mod/tinymce
parent34b14b305f5a106316fdc403c4ce80b25e89b51d (diff)
parent1d11e783557ed5b1fe5ca73d2ad01d1bfc53dbfa (diff)
downloadelgg-a7b63dd21dbc6aa9e7509878dab6734e118ac198.tar.gz
elgg-a7b63dd21dbc6aa9e7509878dab6734e118ac198.tar.bz2
Merge pull request #5092 from cash/tinymce_drag_drop
Refs #4970 prevent Firefox from adding files to TinyMCE editor
Diffstat (limited to 'mod/tinymce')
-rw-r--r--mod/tinymce/views/default/js/tinymce.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/mod/tinymce/views/default/js/tinymce.php b/mod/tinymce/views/default/js/tinymce.php
index b4db43cee..344d71b14 100644
--- a/mod/tinymce/views/default/js/tinymce.php
+++ b/mod/tinymce/views/default/js/tinymce.php
@@ -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'
});