(cm, pos, repeat, event)
| 7361 | } |
| 7362 | |
| 7363 | function leftButtonDown(cm, pos, repeat, event) { |
| 7364 | if (ie) { setTimeout(bind(ensureFocus, cm), 0); } |
| 7365 | else { cm.curOp.focus = activeElt(); } |
| 7366 | |
| 7367 | var behavior = configureMouse(cm, repeat, event); |
| 7368 | |
| 7369 | var sel = cm.doc.sel, contained; |
| 7370 | if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && |
| 7371 | repeat == "single" && (contained = sel.contains(pos)) > -1 && |
| 7372 | (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) && |
| 7373 | (cmp(contained.to(), pos) > 0 || pos.xRel < 0)) |
| 7374 | { leftButtonStartDrag(cm, event, pos, behavior); } |
| 7375 | else |
| 7376 | { leftButtonSelect(cm, event, pos, behavior); } |
| 7377 | } |
| 7378 | |
| 7379 | // Start a text drag. When it ends, see if any dragging actually |
| 7380 | // happen, and treat as a click if it didn't. |
no test coverage detected