MCPcopy Index your code
hub / github.com/DHTMLX/gantt / onMouseDown

Function onMouseDown

samples/common/codehighlight/codemirror.js:7293–7328  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

7291 // middle-click-paste. Or it might be a click on something we should
7292 // not interfere with, such as a scrollbar or widget.
7293 function onMouseDown(e) {
7294 var cm = this, display = cm.display;
7295 if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return }
7296 display.input.ensurePolled();
7297 display.shift = e.shiftKey;
7298
7299 if (eventInWidget(display, e)) {
7300 if (!webkit) {
7301 // Briefly turn off draggability, to allow widgets to do
7302 // normal dragging things.
7303 display.scroller.draggable = false;
7304 setTimeout(function () { return display.scroller.draggable = true; }, 100);
7305 }
7306 return
7307 }
7308 if (clickInGutter(cm, e)) { return }
7309 var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single";
7310 window.focus();
7311
7312 // #3261: make sure, that we're not starting a second selection
7313 if (button == 1 && cm.state.selectingText)
7314 { cm.state.selectingText(e); }
7315
7316 if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }
7317
7318 if (button == 1) {
7319 if (pos) { leftButtonDown(cm, pos, repeat, e); }
7320 else if (e_target(e) == display.scroller) { e_preventDefault(e); }
7321 } else if (button == 2) {
7322 if (pos) { extendSelection(cm.doc, pos); }
7323 setTimeout(function () { return display.input.focus(); }, 20);
7324 } else if (button == 3) {
7325 if (captureRightClick) { cm.display.input.onContextMenu(e); }
7326 else { delayBlurEvent(cm); }
7327 }
7328 }
7329
7330 function handleMappedButton(cm, button, pos, repeat, event) {
7331 var name = "Click";

Callers

nothing calls this directly

Calls 13

signalDOMEventFunction · 0.85
eventInWidgetFunction · 0.85
clickInGutterFunction · 0.85
posFromMouseFunction · 0.85
e_buttonFunction · 0.85
clickRepeatFunction · 0.85
handleMappedButtonFunction · 0.85
leftButtonDownFunction · 0.85
e_targetFunction · 0.85
e_preventDefaultFunction · 0.85
extendSelectionFunction · 0.85
delayBlurEventFunction · 0.85

Tested by

no test coverage detected