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

34 строки
1.0 KiB

  1. import { __assign } from "tslib";
  2. import clamp from 'lodash-es/clamp';
  3. import { setStyle, } from '../utils/';
  4. export function setPosition(scrollbar, x, y) {
  5. var options = scrollbar.options, offset = scrollbar.offset, limit = scrollbar.limit, track = scrollbar.track, contentEl = scrollbar.contentEl;
  6. if (options.renderByPixels) {
  7. x = Math.round(x);
  8. y = Math.round(y);
  9. }
  10. x = clamp(x, 0, limit.x);
  11. y = clamp(y, 0, limit.y);
  12. // position changed -> show track for 300ms
  13. if (x !== offset.x)
  14. track.xAxis.show();
  15. if (y !== offset.y)
  16. track.yAxis.show();
  17. if (!options.alwaysShowTracks) {
  18. track.autoHideOnIdle();
  19. }
  20. if (x === offset.x && y === offset.y) {
  21. return null;
  22. }
  23. offset.x = x;
  24. offset.y = y;
  25. setStyle(contentEl, {
  26. '-transform': "translate3d(" + -x + "px, " + -y + "px, 0)",
  27. });
  28. track.update();
  29. return {
  30. offset: __assign({}, offset),
  31. limit: __assign({}, limit),
  32. };
  33. }
  34. //# sourceMappingURL=set-position.js.map