MCPcopy
hub / github.com/DHTMLX/gantt / addLineWidget

Function addLineWidget

samples/common/codehighlight/codemirror.js:5771–5790  ·  view source on GitHub ↗
(doc, handle, node, options)

Source from the content-addressed store, hash-verified

5769 }
5770
5771 function addLineWidget(doc, handle, node, options) {
5772 var widget = new LineWidget(doc, node, options);
5773 var cm = doc.cm;
5774 if (cm && widget.noHScroll) { cm.display.alignWidgets = true; }
5775 changeLine(doc, handle, "widget", function (line) {
5776 var widgets = line.widgets || (line.widgets = []);
5777 if (widget.insertAt == null) { widgets.push(widget); }
5778 else { widgets.splice(Math.min(widgets.length, Math.max(0, widget.insertAt)), 0, widget); }
5779 widget.line = line;
5780 if (cm && !lineIsHidden(doc, line)) {
5781 var aboveVisible = heightAtLine(line) < doc.scrollTop;
5782 updateLineHeight(line, line.height + widgetHeight(widget));
5783 if (aboveVisible) { addToScrollTop(cm, widget.height); }
5784 cm.curOp.forceUpdate = true;
5785 }
5786 return true
5787 });
5788 if (cm) { signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)); }
5789 return widget
5790 }
5791
5792 // TEXTMARKERS
5793

Callers 1

codemirror.jsFile · 0.85

Calls 8

changeLineFunction · 0.85
lineIsHiddenFunction · 0.85
heightAtLineFunction · 0.85
updateLineHeightFunction · 0.85
widgetHeightFunction · 0.85
addToScrollTopFunction · 0.85
signalLaterFunction · 0.85
lineNoFunction · 0.85

Tested by

no test coverage detected