(widget)
| 2271 | } |
| 2272 | |
| 2273 | function widgetHeight(widget) { |
| 2274 | if (widget.height != null) { return widget.height } |
| 2275 | var cm = widget.doc.cm; |
| 2276 | if (!cm) { return 0 } |
| 2277 | if (!contains(document.body, widget.node)) { |
| 2278 | var parentStyle = "position: relative;"; |
| 2279 | if (widget.coverGutter) |
| 2280 | { parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; } |
| 2281 | if (widget.noHScroll) |
| 2282 | { parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; } |
| 2283 | removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); |
| 2284 | } |
| 2285 | return widget.height = widget.node.parentNode.offsetHeight |
| 2286 | } |
| 2287 | |
| 2288 | // Return true when the given mouse event happened in a widget |
| 2289 | function eventInWidget(display, e) { |
no test coverage detected