@nextcloud/vue
Version:
Nextcloud vue components
1 lines • 1.89 kB
Source Map (JSON)
{"version":3,"file":"IsMobileState-151fc57d.cjs","sources":["../../src/utils/IsMobileState.js"],"sourcesContent":["/**\n * @copyright Copyright (c) 2019 Kristof Hamann, Paul Schwörer\n *\n * @author Kristof Hamann\n * @author Paul Schwörer\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport Vue from 'vue'\n\nexport const IsMobileState = new Vue({\n\tdata() {\n\t\treturn {\n\t\t\tisMobile: false,\n\t\t}\n\t},\n\twatch: {\n\t\tisMobile(val) {\n\t\t\tthis.$emit('changed', val)\n\t\t},\n\t},\n\tcreated() {\n\t\twindow.addEventListener('resize', this.handleWindowResize)\n\t\tthis.handleWindowResize()\n\t},\n\tbeforeDestroy() {\n\t\twindow.removeEventListener('resize', this.handleWindowResize)\n\t},\n\tmethods: {\n\t\thandleWindowResize() {\n\t\t\tthis.isMobile = document.documentElement.clientWidth < 1024\n\t\t},\n\t},\n})\n"],"names":["IsMobileState","Vue","val"],"mappings":"oCAyBaA,EAAgB,IAAIC,EAAI,CACpC,MAAO,CACN,MAAO,CACN,SAAU,EACV,CACD,EACD,MAAO,CACN,SAASC,EAAK,CACb,KAAK,MAAM,UAAWA,CAAG,CACzB,CACD,EACD,SAAU,CACT,OAAO,iBAAiB,SAAU,KAAK,kBAAkB,EACzD,KAAK,mBAAoB,CACzB,EACD,eAAgB,CACf,OAAO,oBAAoB,SAAU,KAAK,kBAAkB,CAC5D,EACD,QAAS,CACR,oBAAqB,CACpB,KAAK,SAAW,SAAS,gBAAgB,YAAc,IACvD,CACD,CACF,CAAC"}