Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

42 строки
1.5 KiB

  1. import { __decorate } from "tslib";
  2. import { ScrollbarTrack } from './track';
  3. import { TrackDirection } from './direction';
  4. import { debounce, } from '../decorators/';
  5. var TrackController = /** @class */ (function () {
  6. function TrackController(_scrollbar) {
  7. this._scrollbar = _scrollbar;
  8. var thumbMinSize = _scrollbar.options.thumbMinSize;
  9. this.xAxis = new ScrollbarTrack(TrackDirection.X, thumbMinSize);
  10. this.yAxis = new ScrollbarTrack(TrackDirection.Y, thumbMinSize);
  11. this.xAxis.attachTo(_scrollbar.containerEl);
  12. this.yAxis.attachTo(_scrollbar.containerEl);
  13. if (_scrollbar.options.alwaysShowTracks) {
  14. this.xAxis.show();
  15. this.yAxis.show();
  16. }
  17. }
  18. /**
  19. * Updates track appearance
  20. */
  21. TrackController.prototype.update = function () {
  22. var _a = this._scrollbar, size = _a.size, offset = _a.offset;
  23. this.xAxis.update(offset.x, size.container.width, size.content.width);
  24. this.yAxis.update(offset.y, size.container.height, size.content.height);
  25. };
  26. /**
  27. * Automatically hide tracks when scrollbar is in idle state
  28. */
  29. TrackController.prototype.autoHideOnIdle = function () {
  30. if (this._scrollbar.options.alwaysShowTracks) {
  31. return;
  32. }
  33. this.xAxis.hide();
  34. this.yAxis.hide();
  35. };
  36. __decorate([
  37. debounce(300)
  38. ], TrackController.prototype, "autoHideOnIdle", null);
  39. return TrackController;
  40. }());
  41. export { TrackController };
  42. //# sourceMappingURL=index.js.map