MCPcopy Create free account
hub / github.com/feiyu563/PrometheusAlert / widgetHeight

Function widgetHeight

static/plugins/codemirror/codemirror.js:2281–2294  ·  view source on GitHub ↗
(widget)

Source from the content-addressed store, hash-verified

2279 }
2280
2281 function widgetHeight(widget) {
2282 if (widget.height != null) { return widget.height }
2283 var cm = widget.doc.cm;
2284 if (!cm) { return 0 }
2285 if (!contains(document.body, widget.node)) {
2286 var parentStyle = "position: relative;";
2287 if (widget.coverGutter)
2288 { parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; }
2289 if (widget.noHScroll)
2290 { parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; }
2291 removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle));
2292 }
2293 return widget.height = widget.node.parentNode.offsetHeight
2294 }
2295
2296 // Return true when the given mouse event happened in a widget
2297 function eventInWidget(display, e) {

Callers 3

widgetTopHeightFunction · 0.85
codemirror.jsFile · 0.85
addLineWidgetFunction · 0.85

Calls 3

removeChildrenAndAddFunction · 0.85
containsFunction · 0.70
eltFunction · 0.70

Tested by

no test coverage detected