You are not logged in.
Pages: 1
On IE6, content can be dragged and dropped into the HTMLArea's iframe. Is there any way to disable this functionality or have a handler function called before the drop is done?
What's particularly a problem is that images can be dragged and dropped into the iframe. They display correctly in the iframe even though they are only on the user's local machine. I'd like to prevent this from happening.
Offline
Submit a feature request http://xinha.python-hosting.com/wiki/Tickets but I'm not sure if it's possible
James Sleeman
Offline
I solved it by overriding the drag handlers. It also occurs on Firefox.
Of course, the ideal thing would be to add an ondrop handler to actually parse the the image/code being dragged and do the appropriate thing (e.g., automatically upload the image). However, this doesn't seem to be possible as the HTML/image content being dragged is not accessible. [On IE, look at the dataTransfer.getData method which only returns URLs and text data. If you're dragging an image or HTML you're out of luck.]
Here is the code I'm using to stop the dragging:
function DisableDragging(editor)
{
if (HTMLArea.is_ie)
{
// IE
HTMLArea._addEvent(editor._doc.body,"dragenter", function() {return false;});
}
else
{
// Firefox
HTMLArea._addEvent(editor._doc, "dragover", function(ev) {HTMLArea._stopEvent(ev); return false;});
HTMLArea._addEvent(editor._textArea,"dragover", function(ev) {HTMLArea._stopEvent(ev); return false;});
}
}
-- Jim
Offline
Pages: 1