{"remainingRequest":"/Users/admin/projects/dms/src/dealer_admin/node_modules/thread-loader/dist/cjs.js!/Users/admin/projects/dms/src/dealer_admin/node_modules/babel-loader/lib/index.js!/Users/admin/projects/dms/src/dealer_admin/src/layout/mixin/ResizeHandler.js","dependencies":[{"path":"/Users/admin/projects/dms/src/dealer_admin/src/layout/mixin/ResizeHandler.js","mtime":1713161556000},{"path":"/Users/admin/projects/dms/src/dealer_admin/babel.config.js","mtime":1713161556000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/Users/admin/projects/dms/src/dealer_admin/node_modules/babel-loader/lib/index.js","mtime":456789000000}],"contextDependencies":[],"result":["import store from '@/store';\nvar _document = document,\n  body = _document.body;\nvar WIDTH = 992; // refer to Bootstrap's responsive design\n\nexport default {\n  watch: {\n    $route: function $route(route) {\n      if (this.device === 'mobile' && this.sidebar.opened) {\n        store.dispatch('app/closeSideBar', {\n          withoutAnimation: false\n        });\n      }\n    }\n  },\n  beforeMount: function beforeMount() {\n    window.addEventListener('resize', this.$_resizeHandler);\n  },\n  beforeDestroy: function beforeDestroy() {\n    window.removeEventListener('resize', this.$_resizeHandler);\n  },\n  mounted: function mounted() {\n    var isMobile = this.$_isMobile();\n    if (isMobile) {\n      store.dispatch('app/toggleDevice', 'mobile');\n      store.dispatch('app/closeSideBar', {\n        withoutAnimation: true\n      });\n    }\n  },\n  methods: {\n    // use $_ for mixins properties\n    // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential\n    $_isMobile: function $_isMobile() {\n      var rect = body.getBoundingClientRect();\n      return rect.width - 1 < WIDTH;\n    },\n    $_resizeHandler: function $_resizeHandler() {\n      if (!document.hidden) {\n        var isMobile = this.$_isMobile();\n        store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop');\n        if (isMobile) {\n          store.dispatch('app/closeSideBar', {\n            withoutAnimation: true\n          });\n        }\n      }\n    }\n  }\n};",null]}