spotlight
spotlight copied to clipboard
Disabling fullscreen not works
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
Yes, I have same problem. For now, I'm doing this:
.spl-fullscreen {
display: none !important;
}
@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:
https://github.com/nextapps-de/spotlight/blob/5160e7910f4cf27ac9300861ce795821059afba3/src/js/spotlight.js#L650-L652
https://github.com/nextapps-de/spotlight/blob/5160e7910f4cf27ac9300861ce795821059afba3/src/js/spotlight.js#L660-L663
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);
}
}