MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / leftButtonDown

Function leftButtonDown

lib/web/CodeMirror/src/edit/mouse_events.js:129–143  ·  view source on GitHub ↗
(cm, pos, repeat, event)

Source from the content-addressed store, hash-verified

127}
128
129function 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.

Callers 1

onMouseDownFunction · 0.70

Calls 9

bindFunction · 0.90
activeEltFunction · 0.90
cmpFunction · 0.90
fromMethod · 0.80
toMethod · 0.80
configureMouseFunction · 0.70
leftButtonStartDragFunction · 0.70
leftButtonSelectFunction · 0.70
containsMethod · 0.45

Tested by

no test coverage detected