MCPcopy
hub / github.com/witheve/Eve / NativeScrollbars

Function NativeScrollbars

src/codemirror.js:401–417  ·  view source on GitHub ↗
(place, scroll, cm)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

eltFunction · 0.85

Tested by

no test coverage detected