mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-06-28 23:05:54 +00:00
Bugfix: exitFullscreen() errors
This commit is contained in:
@@ -11,6 +11,9 @@ export const
|
||||
|
||||
elementById = id => doc.getElementById(id),
|
||||
|
||||
exitFullscreen = () => getFullscreenElement() && (doc.exitFullscreen || doc.webkitExitFullscreen)(),
|
||||
getFullscreenElement = () => doc.fullscreenElement || doc.webkitFullscreenElement,
|
||||
|
||||
Settings = rl.settings,
|
||||
SettingsGet = Settings.get,
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import { serverRequest } from 'Common/Links';
|
||||
import { i18n, getNotification, getUploadErrorDescByCode } from 'Common/Translator';
|
||||
import { timestampToString } from 'Common/Momentor';
|
||||
import { MessageFlagsCache, setFolderHash } from 'Common/Cache';
|
||||
import { doc, Settings, SettingsGet } from 'Common/Globals';
|
||||
import { doc, Settings, SettingsGet, getFullscreenElement, exitFullscreen } from 'Common/Globals';
|
||||
|
||||
import { AppUserStore } from 'Stores/User/App';
|
||||
import { SettingsUserStore } from 'Stores/User/Settings';
|
||||
@@ -643,7 +643,7 @@ class ComposePopupView extends AbstractViewPopup {
|
||||
|
||||
this.resizeObserver.disconnect();
|
||||
|
||||
(doc.fullscreenElement || doc.webkitFullscreenElement) === this.oContent && doc.exitFullscreen();
|
||||
(getFullscreenElement() === this.oContent) && exitFullscreen();
|
||||
}
|
||||
|
||||
editor(fOnInit) {
|
||||
@@ -1267,14 +1267,11 @@ class ComposePopupView extends AbstractViewPopup {
|
||||
event = 'webkit' + event;
|
||||
}
|
||||
if (el.requestFullscreen) {
|
||||
if (!doc.exitFullscreen && doc.webkitExitFullscreen) {
|
||||
doc.exitFullscreen = doc.webkitExitFullscreen;
|
||||
}
|
||||
this.oContent = el;
|
||||
el.addEventListener(event, () =>
|
||||
ThemeStore.isMobile()
|
||||
&& this.modalVisibility()
|
||||
&& (doc.fullscreenElement || doc.webkitFullscreenElement) !== el
|
||||
&& (getFullscreenElement() !== el)
|
||||
&& this.skipCommand()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
MessageSetAction
|
||||
} from 'Common/EnumsUser';
|
||||
|
||||
import { doc, $htmlCL, leftPanelDisabled, keyScopeReal, moveAction, Settings } from 'Common/Globals';
|
||||
import { $htmlCL, leftPanelDisabled, keyScopeReal, moveAction, Settings, getFullscreenElement, exitFullscreen } from 'Common/Globals';
|
||||
|
||||
import { arrayLength, inFocus } from 'Common/Utils';
|
||||
import { mailToHelper, showMessageComposer } from 'Common/UtilsUser';
|
||||
@@ -242,7 +242,7 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
|
||||
|
||||
fullScreenMode: value => {
|
||||
if (this.oContent) {
|
||||
value ? this.oContent.requestFullscreen() : doc.exitFullscreen();
|
||||
value ? this.oContent.requestFullscreen() : exitFullscreen();
|
||||
} else {
|
||||
$htmlCL.toggle('rl-message-fullscreen', value);
|
||||
}
|
||||
@@ -332,12 +332,9 @@ class MessageViewMailBoxUserView extends AbstractViewRight {
|
||||
event = 'webkit'+event;
|
||||
}
|
||||
if (el.requestFullscreen) {
|
||||
if (!doc.exitFullscreen && doc.webkitExitFullscreen) {
|
||||
doc.exitFullscreen = doc.webkitExitFullscreen;
|
||||
}
|
||||
this.oContent = el;
|
||||
el.addEventListener(event, () =>
|
||||
this.fullScreenMode((doc.fullscreenElement || doc.webkitFullscreenElement) === el)
|
||||
this.fullScreenMode(getFullscreenElement() === el)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user