diff options
author | cash <cash.costello@gmail.com> | 2013-02-19 10:46:23 -0500 |
---|---|---|
committer | cash <cash.costello@gmail.com> | 2013-02-19 10:46:23 -0500 |
commit | 1d11e783557ed5b1fe5ca73d2ad01d1bfc53dbfa (patch) | |
tree | e5147759301dd128057a84cf6931f569c3114193 /mod/tinymce | |
parent | 2cc3a9e7d7721b0051bf261ca922972075b72d3c (diff) | |
download | elgg-1d11e783557ed5b1fe5ca73d2ad01d1bfc53dbfa.tar.gz elgg-1d11e783557ed5b1fe5ca73d2ad01d1bfc53dbfa.tar.bz2 |
Refs #4970 prevent Firefox from adding files to TinyMCE editor
Diffstat (limited to 'mod/tinymce')
-rw-r--r-- | mod/tinymce/views/default/js/tinymce.php | 12 |
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' }); |