Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling fullscreen not works #65

Open
adaniello opened this issue Aug 25, 2021 · 2 comments
Open

Disabling fullscreen not works #65

adaniello opened this issue Aug 25, 2021 · 2 comments

Comments

@adaniello
Copy link

If i want hide "fullscreen" icon, eg. via "fullscreen" data attribute by setting it to "false" , i can't.

You can check this issue also in your demo https://nextapps-de.github.io/spotlight/ at the section "Choose Controls (Toolbar)": checkbox not has effect.

Thanks

@mirumirumi
Copy link

Yes, I have same problem.
For now, I'm doing this:

.spl-fullscreen {
  display: none !important;
}

@pryley
Copy link

pryley commented Jan 18, 2022

@ts-thomas

This is happening because the detect_fullscreen function overrides the control option for fullscreen.

Possibly related to #38

Here is the explanation in the code for that function:

// handle when user toggles the fullscreen state manually
// entering the fullscreen state manually needs to be hide the fullscreen icon, because
// the exit fullscreen handler will not work due to a browser restriction

function detect_fullscreen(){
toggleDisplay(maximize, (screen.availHeight - window.innerHeight) > 0);
}

And if I understood it correctly, something like this should fix the problem (?):

function detect_fullscreen(){
    if ((screen.availHeight - window.innerHeight) <= 0) {
        toggleDisplay(maximize, false);
    }
}

However, possibly a more complete solution would be to instead check the fullscreen control option in this function and only proceed if it's not set as hidden. In that case, perhaps something like this is more suitable:

function detect_fullscreen(){
    if (false !== parse_option("fullscreen", controls_default["fullscreen"])) {
        toggleDisplay(maximize, (screen.availHeight - window.innerHeight) > 0);
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants