UNPKG

@nextcloud/vue

Version:
1 lines 1.86 kB
{"version":3,"file":"isFullscreen.mjs","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,IAAA,EACd,OAAO;AACN,SAAO,EACN,cAAc,KAAK,cAAe,EAClC;AACD,GACD,cAAc;AACb,SAAO,iBAAiB,UAAU,KAAK,SAAS;AAChD,GACD,gBAAgB;AACf,SAAO,oBAAoB,UAAU,KAAK,SAAS;AACnD,GACD,SAAS,EACR,YAAY;AAEX,OAAK,eAAe,KAAK,cAAe;AACxC,GACD,gBAAgB;AAGf,SAAO,OAAO,gBAAgB,OAAO;AACrC,EACD,EACF;"}