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

Function extend

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

Source from the content-addressed store, hash-verified

7522 var counter = 0;
7523
7524 function extend(e) {
7525 var curCount = ++counter;
7526 var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle");
7527 if (!cur) { return }
7528 if (cmp(cur, lastPos) != 0) {
7529 cm.curOp.focus = activeElt();
7530 extendTo(cur);
7531 var visible = visibleLines(display, doc);
7532 if (cur.line >= visible.to || cur.line < visible.from)
7533 { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); }
7534 } else {
7535 var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;
7536 if (outside) { setTimeout(operation(cm, function () {
7537 if (counter != curCount) { return }
7538 display.scroller.scrollTop += outside;
7539 extend(e);
7540 }), 50); }
7541 }
7542 }
7543
7544 function done(e) {
7545 cm.state.selectingText = false;

Callers 1

leftButtonSelectFunction · 0.70

Calls 6

posFromMouseFunction · 0.85
cmpFunction · 0.85
activeEltFunction · 0.85
extendToFunction · 0.85
visibleLinesFunction · 0.85
operationFunction · 0.85

Tested by

no test coverage detected