| 3597 | } |
| 3598 | |
| 3599 | var NativeScrollbars = function(place, scroll, cm) { |
| 3600 | this.cm = cm; |
| 3601 | var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); |
| 3602 | var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); |
| 3603 | vert.tabIndex = horiz.tabIndex = -1; |
| 3604 | place(vert); place(horiz); |
| 3605 | |
| 3606 | on(vert, "scroll", function () { |
| 3607 | if (vert.clientHeight) { scroll(vert.scrollTop, "vertical"); } |
| 3608 | }); |
| 3609 | on(horiz, "scroll", function () { |
| 3610 | if (horiz.clientWidth) { scroll(horiz.scrollLeft, "horizontal"); } |
| 3611 | }); |
| 3612 | |
| 3613 | this.checkedZeroWidth = false; |
| 3614 | // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). |
| 3615 | if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; } |
| 3616 | }; |
| 3617 | |
| 3618 | NativeScrollbars.prototype.update = function (measure) { |
| 3619 | var needsH = measure.scrollWidth > measure.clientWidth + 1; |