| 5093 | } |
| 5094 | |
| 5095 | var NativeScrollbars = function (place, scroll, cm) { |
| 5096 | this.cm = cm |
| 5097 | var vert = (this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar")) |
| 5098 | var horiz = (this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar")) |
| 5099 | vert.tabIndex = horiz.tabIndex = -1 |
| 5100 | place(vert) |
| 5101 | place(horiz) |
| 5102 | |
| 5103 | on(vert, "scroll", function () { |
| 5104 | if (vert.clientHeight) { |
| 5105 | scroll(vert.scrollTop, "vertical") |
| 5106 | } |
| 5107 | }) |
| 5108 | on(horiz, "scroll", function () { |
| 5109 | if (horiz.clientWidth) { |
| 5110 | scroll(horiz.scrollLeft, "horizontal") |
| 5111 | } |
| 5112 | }) |
| 5113 | |
| 5114 | this.checkedZeroWidth = false |
| 5115 | // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). |
| 5116 | if (ie && ie_version < 8) { |
| 5117 | this.horiz.style.minHeight = this.vert.style.minWidth = "18px" |
| 5118 | } |
| 5119 | } |
| 5120 | |
| 5121 | NativeScrollbars.prototype.update = function (measure) { |
| 5122 | var needsH = measure.scrollWidth > measure.clientWidth + 1 |