MCPcopy Create free account
hub / github.com/breck7/scroll / widgetHeight

Function widgetHeight

external/.scrollLibs.js:3518–3537  ·  view source on GitHub ↗
(widget)

Source from the content-addressed store, hash-verified

3516 }
3517
3518 function widgetHeight(widget) {
3519 if (widget.height != null) {
3520 return widget.height
3521 }
3522 var cm = widget.doc.cm
3523 if (!cm) {
3524 return 0
3525 }
3526 if (!contains(document.body, widget.node)) {
3527 var parentStyle = "position: relative;"
3528 if (widget.coverGutter) {
3529 parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"
3530 }
3531 if (widget.noHScroll) {
3532 parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"
3533 }
3534 removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle))
3535 }
3536 return (widget.height = widget.node.parentNode.offsetHeight)
3537 }
3538
3539 // Return true when the given mouse event happened in a widget
3540 function eventInWidget(display, e) {

Callers 3

widgetTopHeightFunction · 0.85
.scrollLibs.jsFile · 0.85
addLineWidgetFunction · 0.85

Calls 3

removeChildrenAndAddFunction · 0.85
eltFunction · 0.85
containsFunction · 0.70

Tested by

no test coverage detected