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

Function widgetHeight

static/mergely/lib/codemirror.js:6673–6686  ·  view source on GitHub ↗
(widget)

Source from the content-addressed store, hash-verified

6671 };
6672
6673 function widgetHeight(widget) {
6674 if (widget.height != null) return widget.height;
6675 var cm = widget.doc.cm;
6676 if (!cm) return 0;
6677 if (!contains(document.body, widget.node)) {
6678 var parentStyle = "position: relative;";
6679 if (widget.coverGutter)
6680 parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;";
6681 if (widget.noHScroll)
6682 parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;";
6683 removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle));
6684 }
6685 return widget.height = widget.node.parentNode.offsetHeight;
6686 }
6687
6688 function addLineWidget(doc, handle, node, options) {
6689 var widget = new LineWidget(doc, node, options);

Callers 3

intoCoordSystemFunction · 0.70
codemirror.jsFile · 0.70
addLineWidgetFunction · 0.70

Calls 3

removeChildrenAndAddFunction · 0.70
eltFunction · 0.70
containsFunction · 0.50

Tested by

no test coverage detected