signal-desktop/ts/manage_full_screen_class.ts

15 lines
442 B
TypeScript
Raw Normal View History

2022-07-05 16:44:53 +00:00
// Copyright 2021-2022 Signal Messenger, LLC
2021-02-01 20:01:25 +00:00
// SPDX-License-Identifier: AGPL-3.0-only
2022-05-31 21:42:18 +00:00
{
2022-07-05 16:44:53 +00:00
const updateFullScreenClass = (
isFullScreen: boolean,
isMaximized: boolean
) => {
2022-05-31 21:42:18 +00:00
document.body.classList.toggle('full-screen', isFullScreen);
2022-07-05 16:44:53 +00:00
document.body.classList.toggle('maximized', isMaximized);
2021-02-01 20:01:25 +00:00
};
2022-07-05 16:44:53 +00:00
updateFullScreenClass(window.isFullScreen(), window.isMaximized());
2021-02-01 20:01:25 +00:00
window.onFullScreenChange = updateFullScreenClass;
2022-05-31 21:42:18 +00:00
}