@nextcloud/vue
Version:
Nextcloud vue components
1 lines • 1.9 kB
Source Map (JSON)
{"version":3,"file":"IsMobileState-e1fe5f58.mjs","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":";AAyBY,MAACA,IAAgB,IAAIC,EAAI,EACpC,OAAO;AACN,SAAO,EACN,UAAU,GACV;AACD,GACD,OAAO,EACN,SAASC,GAAK;AACb,OAAK,MAAM,WAAWA,CAAG;AACzB,EACD,GACD,UAAU;AACT,SAAO,iBAAiB,UAAU,KAAK,kBAAkB,GACzD,KAAK,mBAAoB;AACzB,GACD,gBAAgB;AACf,SAAO,oBAAoB,UAAU,KAAK,kBAAkB;AAC5D,GACD,SAAS,EACR,qBAAqB;AACpB,OAAK,WAAW,SAAS,gBAAgB,cAAc;AACvD,EACD,EACF,CAAC;"}