MCPcopy Create free account
hub / github.com/TruthHun/BookStack / onDragStart

Function onDragStart

static/mergely/lib/codemirror.js:3898–3918  ·  view source on GitHub ↗
(cm, e)

Source from the content-addressed store, hash-verified

3896 }
3897
3898 function onDragStart(cm, e) {
3899 if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; }
3900 if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return;
3901
3902 e.dataTransfer.setData("Text", cm.getSelection());
3903
3904 // Use dummy image instead of default browsers image.
3905 // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.
3906 if (e.dataTransfer.setDragImage && !safari) {
3907 var img = elt("img", null, null, "position: fixed; left: 0; top: 0;");
3908 img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
3909 if (presto) {
3910 img.width = img.height = 1;
3911 cm.display.wrapper.appendChild(img);
3912 // Force a relayout, or Opera won't use our image for some obscure reason
3913 img._top = img.offsetTop;
3914 }
3915 e.dataTransfer.setDragImage(img, 0, 0);
3916 if (presto) img.parentNode.removeChild(img);
3917 }
3918 }
3919
3920 function onDragOver(cm, e) {
3921 var pos = posFromMouse(cm, e);

Callers 1

registerEventHandlersFunction · 0.70

Calls 3

signalDOMEventFunction · 0.70
eventInWidgetFunction · 0.70
eltFunction · 0.70

Tested by

no test coverage detected