1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-26 18:10:27 +00:00
TiddlyWiki5/core/plugins/fullscreen/init.js

31 lines
643 B
JavaScript
Raw Normal View History

2012-09-12 09:46:39 +00:00
/*\
title: $:/plugins/tiddlywiki/fullscreen/init.js
type: application/javascript
module-type: browser-startup
Message handler for full screen mode
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
var toggleFullScreen = function() {
if(document[$tw.browser.isFullScreen]) {
document[$tw.browser.cancelFullScreen]();
} else {
2012-10-18 09:52:03 +00:00
document.documentElement[$tw.browser.requestFullScreen](Element.ALLOW_KEYBOARD_INPUT);
2012-09-12 09:46:39 +00:00
}
};
exports.startup = function() {
// Install the full screen handler
document.addEventListener("tw-full-screen",function(event) {
toggleFullScreen();
},false);
};
})();