@nextcloud/vue
Version:
Nextcloud vue components
1 lines • 1.85 kB
Source Map (JSON)
{"version":3,"file":"isFullscreen.cjs","sources":["../../src/mixins/isFullscreen/index.js"],"sourcesContent":["/**\n * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\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\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tisFullscreen: this._isFullscreen(),\n\t\t}\n\t},\n\tbeforeMount() {\n\t\twindow.addEventListener('resize', this._onResize)\n\t},\n\tbeforeDestroy() {\n\t\twindow.removeEventListener('resize', this._onResize)\n\t},\n\tmethods: {\n\t\t_onResize() {\n\t\t\t// Update fullscreen mode\n\t\t\tthis.isFullscreen = this._isFullscreen()\n\t\t},\n\t\t_isFullscreen() {\n\t\t\t// if the window height is equal to the screen height,\n\t\t\t// we're in full screen mode\n\t\t\treturn window.outerHeight === screen.height\n\t\t},\n\t},\n}\n"],"names":["index"],"mappings":"aAsBA,MAAeA,EAAA,CACd,MAAO,CACN,MAAO,CACN,aAAc,KAAK,cAAe,CAClC,CACD,EACD,aAAc,CACb,OAAO,iBAAiB,SAAU,KAAK,SAAS,CAChD,EACD,eAAgB,CACf,OAAO,oBAAoB,SAAU,KAAK,SAAS,CACnD,EACD,QAAS,CACR,WAAY,CAEX,KAAK,aAAe,KAAK,cAAe,CACxC,EACD,eAAgB,CAGf,OAAO,OAAO,cAAgB,OAAO,MACrC,CACD,CACF"}