(cm, e, start)
| 2559 | |
| 2560 | var lastClick, lastDoubleClick; |
| 2561 | function leftButtonDown(cm, e, start) { |
| 2562 | setTimeout(bind(ensureFocus, cm), 0); |
| 2563 | |
| 2564 | var now = +new Date, type; |
| 2565 | if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) { |
| 2566 | type = "triple"; |
| 2567 | } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) { |
| 2568 | type = "double"; |
| 2569 | lastDoubleClick = {time: now, pos: start}; |
| 2570 | } else { |
| 2571 | type = "single"; |
| 2572 | lastClick = {time: now, pos: start}; |
| 2573 | } |
| 2574 | |
| 2575 | var sel = cm.doc.sel, addNew = mac ? e.metaKey : e.ctrlKey; |
| 2576 | if (cm.options.dragDrop && dragAndDrop && !addNew && !isReadOnly(cm) && |
| 2577 | type == "single" && sel.contains(start) > -1 && sel.somethingSelected()) |
| 2578 | leftButtonStartDrag(cm, e, start); |
| 2579 | else |
| 2580 | leftButtonSelect(cm, e, start, type, addNew); |
| 2581 | } |
| 2582 | |
| 2583 | // Start a text drag. When it ends, see if any dragging actually |
| 2584 | // happen, and treat as a click if it didn't. |
no test coverage detected
searching dependent graphs…