(widget)
| 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) { |
no test coverage detected