(cm, pos, repeat, event)
| 10077 | } |
| 10078 | |
| 10079 | function leftButtonDown(cm, pos, repeat, event) { |
| 10080 | if (ie) { |
| 10081 | setTimeout(bind(ensureFocus, cm), 0) |
| 10082 | } else { |
| 10083 | cm.curOp.focus = activeElt() |
| 10084 | } |
| 10085 | |
| 10086 | var behavior = configureMouse(cm, repeat, event) |
| 10087 | |
| 10088 | var sel = cm.doc.sel, |
| 10089 | contained |
| 10090 | if ( |
| 10091 | cm.options.dragDrop && |
| 10092 | dragAndDrop && |
| 10093 | !cm.isReadOnly() && |
| 10094 | repeat == "single" && |
| 10095 | (contained = sel.contains(pos)) > -1 && |
| 10096 | (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) && |
| 10097 | (cmp(contained.to(), pos) > 0 || pos.xRel < 0) |
| 10098 | ) { |
| 10099 | leftButtonStartDrag(cm, event, pos, behavior) |
| 10100 | } else { |
| 10101 | leftButtonSelect(cm, event, pos, behavior) |
| 10102 | } |
| 10103 | } |
| 10104 | |
| 10105 | // Start a text drag. When it ends, see if any dragging actually |
| 10106 | // happen, and treat as a click if it didn't. |
no test coverage detected