MCPcopy Create free account
hub / github.com/TruthHun/BookStack / NativeScrollbars

Function NativeScrollbars

static/editor.md/lib/codemirror/lib/codemirror.js:394–410  ·  view source on GitHub ↗
(place, scroll, cm)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

scrollFunction · 0.85
eltFunction · 0.70
onFunction · 0.50

Tested by

no test coverage detected