MCPcopy
hub / github.com/DHTMLX/gantt / leftButtonDown

Function leftButtonDown

samples/common/codehighlight/codemirror.js:7363–7377  ·  view source on GitHub ↗
(cm, pos, repeat, event)

Source from the content-addressed store, hash-verified

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.

Callers 1

onMouseDownFunction · 0.85

Calls 6

activeEltFunction · 0.85
configureMouseFunction · 0.85
cmpFunction · 0.85
leftButtonStartDragFunction · 0.85
leftButtonSelectFunction · 0.85
bindFunction · 0.70

Tested by

no test coverage detected