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

Function gutterEvent

samples/common/codehighlight/codemirror.js:7606–7633  ·  view source on GitHub ↗
(cm, e, type, prevent)

Source from the content-addressed store, hash-verified

7604 // Determines whether an event happened in the gutter, and fires the
7605 // handlers for the corresponding event.
7606 function gutterEvent(cm, e, type, prevent) {
7607 var mX, mY;
7608 if (e.touches) {
7609 mX = e.touches[0].clientX;
7610 mY = e.touches[0].clientY;
7611 } else {
7612 try { mX = e.clientX; mY = e.clientY; }
7613 catch(e$1) { return false }
7614 }
7615 if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }
7616 if (prevent) { e_preventDefault(e); }
7617
7618 var display = cm.display;
7619 var lineBox = display.lineDiv.getBoundingClientRect();
7620
7621 if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) }
7622 mY -= lineBox.top - display.viewOffset;
7623
7624 for (var i = 0; i < cm.display.gutterSpecs.length; ++i) {
7625 var g = display.gutters.childNodes[i];
7626 if (g && g.getBoundingClientRect().right >= mX) {
7627 var line = lineAtHeight(cm.doc, mY);
7628 var gutter = cm.display.gutterSpecs[i];
7629 signal(cm, type, cm, line, gutter.className, e);
7630 return e_defaultPrevented(e)
7631 }
7632 }
7633 }
7634
7635 function clickInGutter(cm, e) {
7636 return gutterEvent(cm, e, "gutterClick", true)

Callers 2

clickInGutterFunction · 0.85
contextMenuInGutterFunction · 0.85

Calls 5

e_preventDefaultFunction · 0.85
hasHandlerFunction · 0.85
e_defaultPreventedFunction · 0.85
lineAtHeightFunction · 0.85
signalFunction · 0.85

Tested by

no test coverage detected