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

Function insertLineWidgetsFor

static/mergely/lib/codemirror.js:1041–1055  ·  view source on GitHub ↗
(cm, line, lineView, dims, allowAbove)

Source from the content-addressed store, hash-verified

1039 }
1040
1041 function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {
1042 if (!line.widgets) return;
1043 var wrap = ensureLineWrapped(lineView);
1044 for (var i = 0, ws = line.widgets; i < ws.length; ++i) {
1045 var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget");
1046 if (!widget.handleMouseEvents) node.setAttribute("cm-ignore-events", "true");
1047 positionLineWidget(widget, node, lineView, dims);
1048 cm.display.input.setUneditable(node);
1049 if (allowAbove && widget.above)
1050 wrap.insertBefore(node, lineView.gutter || lineView.text);
1051 else
1052 wrap.appendChild(node);
1053 signalLater(widget, "redraw");
1054 }
1055 }
1056
1057 function positionLineWidget(widget, node, lineView, dims) {
1058 if (widget.noHScroll) {

Callers 1

insertLineWidgetsFunction · 0.70

Calls 5

ensureLineWrappedFunction · 0.70
eltFunction · 0.70
positionLineWidgetFunction · 0.70
signalLaterFunction · 0.70
setAttributeMethod · 0.45

Tested by

no test coverage detected