1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-24 17:10:29 +00:00

Make tm-full-screen work in all windows (#3334)

this makes tm-full-screen work in new windows, too
This commit is contained in:
BurningTreeC 2018-06-16 11:03:38 +02:00 committed by Jeremy Ruston
parent 7557b8b5b7
commit 2a3f1b4403

View File

@ -42,10 +42,10 @@ exports.startup = function() {
var fullscreen = $tw.utils.getFullScreenApis();
if(fullscreen) {
$tw.rootWidget.addEventListener("tm-full-screen",function(event) {
if(document[fullscreen._fullscreenElement]) {
document[fullscreen._exitFullscreen]();
if(event.event.target.ownerDocument[fullscreen._fullscreenElement]) {
event.event.target.ownerDocument[fullscreen._exitFullscreen]();
} else {
document.documentElement[fullscreen._requestFullscreen](Element.ALLOW_KEYBOARD_INPUT);
event.event.target.ownerDocument.documentElement[fullscreen._requestFullscreen](Element.ALLOW_KEYBOARD_INPUT);
}
});
}