File tree Expand file tree Collapse file tree 3 files changed +29
-27
lines changed Expand file tree Collapse file tree 3 files changed +29
-27
lines changed Original file line number Diff line number Diff line change 33 * SPDX-License-Identifier: AGPL-3.0-or-later
44 */
55
6- export * from './useIsFullscreen/index.js'
7- export * from './useIsMobile/index.js'
86export * from './useFormatDateTime.ts'
97export * from './useHotKey/index.ts'
108export * from './useIsDarkTheme/index.ts'
9+ export * from './useIsFullscreen/index.ts'
10+ export * from './useIsMobile/index.js'
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ /**
2+ * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
3+ * SPDX-License-Identifier: AGPL-3.0-or-later
4+ */
5+ import type { Ref } from 'vue'
6+ import { readonly , ref } from 'vue'
7+
8+ const isFullscreen = ref ( checkIfIsFullscreen ( ) )
9+
10+ window . addEventListener ( 'resize' , ( ) => {
11+ isFullscreen . value = checkIfIsFullscreen ( )
12+ } )
13+
14+ /**
15+ * If the window height is equal to the screen height,
16+ * we are in full screen mode.
17+ */
18+ function checkIfIsFullscreen ( ) : boolean {
19+ return window . outerHeight === window . screen . height
20+ }
21+
22+ /**
23+ * Use global `isFullscreen` state, based on the screen height check.
24+ */
25+ export function useIsFullscreen ( ) : Readonly < Ref < boolean > > {
26+ return readonly ( isFullscreen )
27+ }
You can’t perform that action at this time.
0 commit comments