MCPcopy Create free account
hub / github.com/TruthHun/BookStack / extend

Function extend

static/mergely/lib/codemirror.js:3766–3784  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

3764 var counter = 0;
3765
3766 function extend(e) {
3767 var curCount = ++counter;
3768 var cur = posFromMouse(cm, e, true, type == "rect");
3769 if (!cur) return;
3770 if (cmp(cur, lastPos) != 0) {
3771 cm.curOp.focus = activeElt();
3772 extendTo(cur);
3773 var visible = visibleLines(display, doc);
3774 if (cur.line >= visible.to || cur.line < visible.from)
3775 setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);
3776 } else {
3777 var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;
3778 if (outside) setTimeout(operation(cm, function() {
3779 if (counter != curCount) return;
3780 display.scroller.scrollTop += outside;
3781 extend(e);
3782 }), 50);
3783 }
3784 }
3785
3786 function done(e) {
3787 cm.state.selectingText = false;

Callers 1

leftButtonSelectFunction · 0.70

Calls 6

posFromMouseFunction · 0.70
activeEltFunction · 0.70
extendToFunction · 0.70
visibleLinesFunction · 0.70
operationFunction · 0.70
cmpFunction · 0.50

Tested by

no test coverage detected