signal-desktop/ts/manage_full_screen_class.ts
2023-01-03 11:55:46 -08:00

14 lines
437 B
TypeScript

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
{
const updateFullScreenClass = (
isFullScreen: boolean,
isMaximized: boolean
) => {
document.body.classList.toggle('full-screen', isFullScreen);
document.body.classList.toggle('maximized', isMaximized);
};
updateFullScreenClass(window.isFullScreen(), window.isMaximized());
window.onFullScreenChange = updateFullScreenClass;
}