@nextcloud/vue
Version:
Nextcloud vue components
1 lines • 1.06 kB
Source Map (JSON)
{"version":3,"file":"index.mjs","sources":["../../../src/composables/useIsFullscreen/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { Ref } from 'vue'\n\nimport { readonly, ref } from 'vue'\n\nconst isFullscreen = ref(checkIfIsFullscreen())\n\nwindow.addEventListener('resize', () => {\n\tisFullscreen.value = checkIfIsFullscreen()\n})\n\n/**\n * If the window height is equal to the screen height,\n * we are in full screen mode.\n */\nfunction checkIfIsFullscreen(): boolean {\n\treturn window.outerHeight === window.screen.height\n}\n\n/**\n * Use global `isFullscreen` state, based on the screen height check.\n */\nexport function useIsFullscreen(): Readonly<Ref<boolean>> {\n\treturn readonly(isFullscreen)\n}\n"],"names":[],"mappings":";AASA,MAAM,eAAe,IAAI,qBAAqB;AAE9C,OAAO,iBAAiB,UAAU,MAAM;AACvC,eAAa,QAAQ,oBAAA;AACtB,CAAC;AAMD,SAAS,sBAA+B;AACvC,SAAO,OAAO,gBAAgB,OAAO,OAAO;AAC7C;AAKO,SAAS,kBAA0C;AACzD,SAAO,SAAS,YAAY;AAC7B;"}