(cm, pos, repeat, event)
| 127 | } |
| 128 | |
| 129 | function leftButtonDown(cm, pos, repeat, event) { |
| 130 | if (ie) setTimeout(bind(ensureFocus, cm), 0) |
| 131 | else cm.curOp.focus = activeElt() |
| 132 | |
| 133 | let behavior = configureMouse(cm, repeat, event) |
| 134 | |
| 135 | let sel = cm.doc.sel, contained |
| 136 | if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && |
| 137 | repeat == "single" && (contained = sel.contains(pos)) > -1 && |
| 138 | (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) && |
| 139 | (cmp(contained.to(), pos) > 0 || pos.xRel < 0)) |
| 140 | leftButtonStartDrag(cm, event, pos, behavior) |
| 141 | else |
| 142 | leftButtonSelect(cm, event, pos, behavior) |
| 143 | } |
| 144 | |
| 145 | // Start a text drag. When it ends, see if any dragging actually |
| 146 | // happen, and treat as a click if it didn't. |
no test coverage detected