MCPcopy Index your code
hub / github.com/witheve/Eve / onDragStart

Function onDragStart

src/codemirror.js:3920–3941  ·  view source on GitHub ↗
(cm, e)

Source from the content-addressed store, hash-verified

3918 }
3919
3920 function onDragStart(cm, e) {
3921 if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; }
3922 if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return;
3923
3924 e.dataTransfer.setData("Text", cm.getSelection());
3925 e.dataTransfer.effectAllowed = "copyMove"
3926
3927 // Use dummy image instead of default browsers image.
3928 // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.
3929 if (e.dataTransfer.setDragImage && !safari) {
3930 var img = elt("img", null, null, "position: fixed; left: 0; top: 0;");
3931 img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
3932 if (presto) {
3933 img.width = img.height = 1;
3934 cm.display.wrapper.appendChild(img);
3935 // Force a relayout, or Opera won't use our image for some obscure reason
3936 img._top = img.offsetTop;
3937 }
3938 e.dataTransfer.setDragImage(img, 0, 0);
3939 if (presto) img.parentNode.removeChild(img);
3940 }
3941 }
3942
3943 function onDragOver(cm, e) {
3944 var pos = posFromMouse(cm, e);

Callers 1

registerEventHandlersFunction · 0.85

Calls 4

signalDOMEventFunction · 0.85
eventInWidgetFunction · 0.85
eltFunction · 0.85
getSelectionMethod · 0.80

Tested by

no test coverage detected