Detect Fullscreen mode

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

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
FangLi
by
New Contributor II

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
FangLi
by
New Contributor II

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

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 Honored Contributor

The states are

active | ready | feature-unsupported | disabled