layout.ts 987 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * --------------------------------------------
  3. * AdminLTE treeview.ts
  4. * License MIT
  5. * --------------------------------------------
  6. */
  7. import {
  8. domReady
  9. } from './util/index'
  10. /**
  11. * ------------------------------------------------------------------------
  12. * Constants
  13. * ------------------------------------------------------------------------
  14. */
  15. const CLASS_NAME_RESIZE_ANIMATION_STOPPER = 'resize-animation-stopper'
  16. /**
  17. * Class Definition
  18. * ====================================================
  19. */
  20. class Layout {
  21. holdTransition(): void {
  22. let resizeTimer: number | undefined
  23. window.addEventListener('resize', () => {
  24. document.body.classList.add(CLASS_NAME_RESIZE_ANIMATION_STOPPER)
  25. clearTimeout(resizeTimer)
  26. resizeTimer = setTimeout(() => {
  27. document.body.classList.remove(CLASS_NAME_RESIZE_ANIMATION_STOPPER)
  28. }, 400)
  29. })
  30. }
  31. }
  32. domReady(() => {
  33. const data = new Layout()
  34. data.holdTransition()
  35. })
  36. export default Layout