Skip to content

Commit

Permalink
wip: Enhance capabilities to handle fullscreen mode #913
Browse files Browse the repository at this point in the history
  • Loading branch information
cnouguier committed Aug 1, 2024
1 parent dee163c commit 63a3b9b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions core/client/components/action/KToggleFullscreenAction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<script setup>
import _ from 'lodash'
import { ref, watch } from 'vue'
import { actionProps, isFullscreen, toggleFullscreen } from '../../utils'
import { actionProps, Fullscreen, toggleFullscreen } from '../../utils'
import KAction from './KAction.vue'
// Props
Expand All @@ -19,7 +19,7 @@ const props = defineProps(_.omit(actionProps, ['url', 'handler', 'dialog', 'rout
const actionRef = ref(null)
// Watch
watch(isFullscreen, () => {
if (actionRef.value.isToggled !== isFullscreen.value) actionRef.value.toggle()
watch(Fullscreen, () => {
if (actionRef.value.isToggled !== Fullscreen.value) actionRef.value.toggle()
})
</script>
7 changes: 3 additions & 4 deletions core/client/utils/utils.screen.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import _ from 'lodash'
import logger from 'loglevel'
import {toRef } from 'vue'
import { toRef } from 'vue'
import { Screen } from 'quasar'
import { AppFullscreen } from 'quasar'

export const isFullscreen = toRef(AppFullscreen, 'isActive')
export const Fullscreen = toRef(AppFullscreen, 'isActive')

export function computeResponsiveWidth (width) {
let breakpointWidth = width
Expand Down Expand Up @@ -51,8 +51,7 @@ export function computeResponsiveSize (size) {
}

export function getOrientation () {
if (window) return window.screen.orientation
return Screen.width > Screen.height ? 'portrait' : 'landscape'
return Screen.width > Screen.height ? 'portrait' : 'landscape'
}

export async function toggleFullscreen () {
Expand Down

0 comments on commit 63a3b9b

Please sign in to comment.