I am also investigating this, I was able to disable drag and drop *within* the editor by using an on 'dragstart' and the doing preventDefault(true) on this event.
However when I drag from outside the browser into ckeditor not only can I not detect it but the dataprocessor seems to be ignored. I am on Chrome at the moment.
But I sure don't find any of that code in ckeditor's source now. I am wondering if this is something I just need to use an external library like jquery to handle?
Re: Drag and drop event ckeditor
Re: Drag and drop event ckeditor
I am also investigating this,
I was able to disable drag and drop *within* the editor by using an on 'dragstart' and the doing preventDefault(true) on this event.
However when I drag from outside the browser into ckeditor not only can I not detect it but the dataprocessor seems to be ignored. I am on Chrome at the moment.
I found this 5 year old discussion on the topic:
viewtopic.php?f=5&t=6155
and this 5 year old ticket:
http://dev.ckeditor.com/ticket/338
But I sure don't find any of that code in ckeditor's source now. I am wondering if this is something I just need to use an external library like jquery to handle?
Re: Drag and drop event ckeditor
CKEDITOR.on('instanceReady', function (ev) { // Prevent drag-and-drop. ev.editor.document.on('drop', function (ev) { ev.data.preventDefault(true); }); });Re: Drag and drop event ckeditor
var dragstart_outside = true; ev.editor.document.on('dragstart', function (ev) { dragstart_outside = false; }); ev.editor.document.on('drop', function (ev) { if (dragstart_outside) { ev.data.preventDefault(true); } dragstart_outside = true; });Between 'instanceReady' and
Between 'instanceReady' and 'drop', you need to add 'contentDom'...Something like this:
CKEDITOR.plugins.add(
CKEDITOR.plugins.add('myplugin', { init: function (editor) { function onDragStart(event) { console.log("onDragStart"); }; editor.on('contentDom', function (e) { editor.document.on('dragstart', onDragStart); // editor.document.on('drop', onDrop); // etc. }); } });If this thread is still relevant, this worked in a plugin...