1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-19 00:04:51 +00:00
TiddlyWiki5/core/plugins/fullscreen/init.js
2012-09-12 10:46:39 +01:00

31 lines
615 B
JavaScript

/*\
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 {
document.documentElement[$tw.browser.requestFullScreen]();
}
};
exports.startup = function() {
// Install the full screen handler
document.addEventListener("tw-full-screen",function(event) {
toggleFullScreen();
},false);
};
})();