mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Resolve #298
This commit is contained in:
parent
40a0391092
commit
13f270f426
9 changed files with 75 additions and 90 deletions
|
|
@ -11,8 +11,12 @@ export const
|
|||
|
||||
elementById = id => doc.getElementById(id),
|
||||
|
||||
exitFullscreen = () => getFullscreenElement() && (doc.exitFullscreen || doc.webkitExitFullscreen).call(doc),
|
||||
getFullscreenElement = () => doc.fullscreenElement || doc.webkitFullscreenElement,
|
||||
// Fullscreen must be on app, else other popups fail
|
||||
app = doc.getElementById('rl-app'),
|
||||
appFullscreen = () => (doc.fullscreenElement || doc.webkitFullscreenElement) === app,
|
||||
exitFullscreen = () => appFullscreen() && (doc.exitFullscreen || doc.webkitExitFullscreen).call(doc),
|
||||
isFullscreen = ko.observable(false),
|
||||
toggleFullscreen = () => isFullscreen() ? exitFullscreen() : app.requestFullscreen(),
|
||||
|
||||
Settings = rl.settings,
|
||||
SettingsGet = Settings.get,
|
||||
|
|
@ -61,6 +65,20 @@ export const
|
|||
shortcuts.setScope(value);
|
||||
};
|
||||
|
||||
if (app) {
|
||||
let event = 'fullscreenchange';
|
||||
if (!app.requestFullscreen && app.webkitRequestFullscreen) {
|
||||
app.requestFullscreen = app.webkitRequestFullscreen;
|
||||
event = 'webkit'+event;
|
||||
}
|
||||
if (app.requestFullscreen) {
|
||||
doc.addEventListener(event, () => {
|
||||
isFullscreen(appFullscreen());
|
||||
$htmlCL.toggle('rl-fullscreen', appFullscreen());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
dropdownVisibility.subscribe(value => {
|
||||
if (value) {
|
||||
keyScope(ScopeMenu);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue