MCPcopy Create free account
hub / github.com/breck7/scroll / leftButtonDown

Function leftButtonDown

external/.scrollLibs.js:10079–10103  ·  view source on GitHub ↗
(cm, pos, repeat, event)

Source from the content-addressed store, hash-verified

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.

Callers 1

onMouseDownFunction · 0.85

Calls 8

bindFunction · 0.85
activeEltFunction · 0.85
configureMouseFunction · 0.85
cmpFunction · 0.85
leftButtonStartDragFunction · 0.85
leftButtonSelectFunction · 0.85
containsMethod · 0.80
fromMethod · 0.45

Tested by

no test coverage detected