您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

1 行
1.6 KiB

  1. {"ast":null,"code":"import { ScrollbarThumb } from './thumb';\nimport { setStyle } from '../utils/';\n\nvar ScrollbarTrack =\n/** @class */\nfunction () {\n function ScrollbarTrack(direction, thumbMinSize) {\n if (thumbMinSize === void 0) {\n thumbMinSize = 0;\n }\n /**\n * Track element\n */\n\n\n this.element = document.createElement('div');\n this._isShown = false;\n this.element.className = \"scrollbar-track scrollbar-track-\" + direction;\n this.thumb = new ScrollbarThumb(direction, thumbMinSize);\n this.thumb.attachTo(this.element);\n }\n /**\n * Attach to scrollbar container element\n *\n * @param scrollbarContainer Scrollbar container element\n */\n\n\n ScrollbarTrack.prototype.attachTo = function (scrollbarContainer) {\n scrollbarContainer.appendChild(this.element);\n };\n /**\n * Show track immediately\n */\n\n\n ScrollbarTrack.prototype.show = function () {\n if (this._isShown) {\n return;\n }\n\n this._isShown = true;\n this.element.classList.add('show');\n };\n /**\n * Hide track immediately\n */\n\n\n ScrollbarTrack.prototype.hide = function () {\n if (!this._isShown) {\n return;\n }\n\n this._isShown = false;\n this.element.classList.remove('show');\n };\n\n ScrollbarTrack.prototype.update = function (scrollOffset, containerSize, pageSize) {\n setStyle(this.element, {\n display: pageSize <= containerSize ? 'none' : 'block'\n });\n this.thumb.update(scrollOffset, containerSize, pageSize);\n };\n\n return ScrollbarTrack;\n}();\n\nexport { ScrollbarTrack };","map":null,"metadata":{},"sourceType":"module"}