mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-24 07:32:27 +01:00
Add Fullscreen autocommand
This commit is contained in:
@@ -269,6 +269,8 @@ function Events() //{{{
|
||||
|
||||
const input = liberator.input;
|
||||
|
||||
var fullscreen = window.fullScreen;
|
||||
|
||||
var inputBufferLength = 0; // count the number of keys in v.input.buffer (can be different from v.input.buffer.length)
|
||||
var skipMap = false; // while feeding the keys (stored in v.input.buffer | no map found) - ignore mappings
|
||||
|
||||
@@ -360,6 +362,7 @@ function Events() //{{{
|
||||
window.addEventListener("popuphidden", exitPopupMode, true);
|
||||
window.addEventListener("DOMMenuBarActive", enterMenuMode, true);
|
||||
window.addEventListener("DOMMenuBarInactive", exitMenuMode, true);
|
||||
window.addEventListener("resize", onResize, true);
|
||||
|
||||
// window.document.addEventListener("DOMTitleChanged", function (event)
|
||||
// {
|
||||
@@ -469,6 +472,16 @@ function Events() //{{{
|
||||
autocommands.trigger(name, args);
|
||||
}
|
||||
|
||||
function onResize(event)
|
||||
{
|
||||
if (window.fullScreen != fullscreen)
|
||||
{
|
||||
fullscreen = window.fullScreen;
|
||||
liberator.triggerObserver("fullscreen", fullscreen);
|
||||
autocommands.trigger("Fullscreen", {url: "", fullscreen: fullscreen});
|
||||
}
|
||||
}
|
||||
|
||||
function onDOMContentLoaded(event)
|
||||
{
|
||||
if (event.originalTarget instanceof HTMLDocument)
|
||||
|
||||
Reference in New Issue
Block a user