(cm, e)
| 2795 | } |
| 2796 | |
| 2797 | function onDragStart(cm, e) { |
| 2798 | if (ie_upto10 && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; } |
| 2799 | if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return; |
| 2800 | |
| 2801 | e.dataTransfer.setData("Text", cm.getSelection()); |
| 2802 | |
| 2803 | // Use dummy image instead of default browsers image. |
| 2804 | // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. |
| 2805 | if (e.dataTransfer.setDragImage && !safari) { |
| 2806 | var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); |
| 2807 | img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; |
| 2808 | if (presto) { |
| 2809 | img.width = img.height = 1; |
| 2810 | cm.display.wrapper.appendChild(img); |
| 2811 | // Force a relayout, or Opera won't use our image for some obscure reason |
| 2812 | img._top = img.offsetTop; |
| 2813 | } |
| 2814 | e.dataTransfer.setDragImage(img, 0, 0); |
| 2815 | if (presto) img.parentNode.removeChild(img); |
| 2816 | } |
| 2817 | } |
| 2818 | |
| 2819 | // SCROLL EVENTS |
| 2820 |
no test coverage detected