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