javascript - Drag and drop event in a contentEditable element -
If something is left in the content, then what event is removed (after dragging)?
Talking about a plain old drag and drop, do not drag and drop HTML (where any element can be dragable); The use case is simply:
- On the page there is a content editable diva, which is used as an editor
- Users can either from the current page or any other page Leaves some HTML except, or from another browser window (hence, there really is no concept of "source" object: the source can come from outside the browser)
- I should be informed That content was removed in it ContentEditable div is so much that I can work on it (clear it)
I can see Div what is not anything that is not clear, but it is expensive and " Ugly "; Surely there is an incident that occurs when a drop occurs ...?
I encountered the same problem while writing a tinyMCE plugin What elements of the drag and drop elements The best way to track me is to hear the 'domainedist' event on the content in the disabled area.
Note that this element is removed by the content when a disabled element is dropped so that its target asset is set to this element. You can retrieve the element that went away by checking event.originalEvent.target property.
Keep in mind that this event has been removed after the fall is over and the drop element has been inserted.
$ ('# editor'). Bind ('dominated', function) {if (event.originalEvent & event.originalEvent.target) {var Target = $ (event.originalEvent.target); // Now you can see what went on }});
Comments
Post a Comment