| 398 | } |
| 399 | |
| 400 | function NativeScrollbars(place, scroll, cm) { |
| 401 | this.cm = cm; |
| 402 | var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); |
| 403 | var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); |
| 404 | place(vert); place(horiz); |
| 405 | |
| 406 | on(vert, "scroll", function() { |
| 407 | if (vert.clientHeight) scroll(vert.scrollTop, "vertical"); |
| 408 | }); |
| 409 | on(horiz, "scroll", function() { |
| 410 | if (horiz.clientWidth) scroll(horiz.scrollLeft, "horizontal"); |
| 411 | }); |
| 412 | |
| 413 | this.checkedZeroWidth = false; |
| 414 | // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). |
| 415 | if (ie && ie_version < 8) this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; |
| 416 | } |
| 417 | |
| 418 | NativeScrollbars.prototype = copyObj({ |
| 419 | update: function(measure) { |