Detect Fullscreen mode

1071
3
Jump to solution
05-01-2019 02:58 PM
GregoryBologna
Occasional Contributor II

I would like to detect whether full screen is active and disable a function action on my popup. Would there be a property for this in the view?

0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

You could watch the `state` property on FullscreenViewModel to detect if Fullscreen widget is active. Please see code below:

watchUtils.watch(fullscreenWidget.viewModel, "state", (value)=>{
   if(value === "active"){
         console.log("Entered Fullscreen mode");
    }
})

View solution in original post

0 Kudos
3 Replies
by Anonymous User
Not applicable

You could watch the `state` property on FullscreenViewModel to detect if Fullscreen widget is active. Please see code below:

watchUtils.watch(fullscreenWidget.viewModel, "state", (value)=>{
   if(value === "active"){
         console.log("Entered Fullscreen mode");
    }
})

0 Kudos
GregoryBologna
Occasional Contributor II

What are all of the states of FullScreen? I'm looking for a "click" state because the watch on "state" happens when the browser is already going into fullstate mode.

var fullscreenWatch = watchUtils.watch(fullscreen.viewModel"state"function (newValueoldValue) {
0 Kudos
KenBuja
MVP Esteemed Contributor

The states are

active | ready | feature-unsupported | disabled