Move class change handlers to init

This commit is contained in:
Bill Thornton 2024-08-14 16:33:25 -04:00
parent 4f2edf416a
commit 4af7fc6e3e

View File

@ -58,6 +58,14 @@ build: ${__JF_BUILD_VERSION__}`);
window.Events = Events; window.Events = Events;
window.TaskButton = taskButton; window.TaskButton = taskButton;
// Register handlers to update header classes
pageClassOn('viewshow', 'standalonePage', function () {
document.querySelector('.skinHeader').classList.add('noHeaderRight');
});
pageClassOn('viewhide', 'standalonePage', function () {
document.querySelector('.skinHeader').classList.remove('noHeaderRight');
});
// Initialize the api client // Initialize the api client
const serverUrl = await serverAddress(); const serverUrl = await serverAddress();
if (serverUrl) { if (serverUrl) {
@ -253,11 +261,3 @@ async function renderApp() {
} }
init(); init();
pageClassOn('viewshow', 'standalonePage', function () {
document.querySelector('.skinHeader').classList.add('noHeaderRight');
});
pageClassOn('viewhide', 'standalonePage', function () {
document.querySelector('.skinHeader').classList.remove('noHeaderRight');
});