You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 line
1.5 KiB

  1. {"ast":null,"code":"import { __decorate } from \"tslib\";\nimport { ScrollbarTrack } from './track';\nimport { TrackDirection } from './direction';\nimport { debounce } from '../decorators/';\n\nvar TrackController =\n/** @class */\nfunction () {\n function TrackController(_scrollbar) {\n this._scrollbar = _scrollbar;\n var thumbMinSize = _scrollbar.options.thumbMinSize;\n this.xAxis = new ScrollbarTrack(TrackDirection.X, thumbMinSize);\n this.yAxis = new ScrollbarTrack(TrackDirection.Y, thumbMinSize);\n this.xAxis.attachTo(_scrollbar.containerEl);\n this.yAxis.attachTo(_scrollbar.containerEl);\n\n if (_scrollbar.options.alwaysShowTracks) {\n this.xAxis.show();\n this.yAxis.show();\n }\n }\n /**\n * Updates track appearance\n */\n\n\n TrackController.prototype.update = function () {\n var _a = this._scrollbar,\n size = _a.size,\n offset = _a.offset;\n this.xAxis.update(offset.x, size.container.width, size.content.width);\n this.yAxis.update(offset.y, size.container.height, size.content.height);\n };\n /**\n * Automatically hide tracks when scrollbar is in idle state\n */\n\n\n TrackController.prototype.autoHideOnIdle = function () {\n if (this._scrollbar.options.alwaysShowTracks) {\n return;\n }\n\n this.xAxis.hide();\n this.yAxis.hide();\n };\n\n __decorate([debounce(300)], TrackController.prototype, \"autoHideOnIdle\", null);\n\n return TrackController;\n}();\n\nexport { TrackController };","map":null,"metadata":{},"sourceType":"module"}