signal-desktop/ts/manage_full_screen_class.ts
2022-07-05 09:44:53 -07:00

14 lines
442 B
TypeScript

// Copyright 2021-2022 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;
}