From 4af7fc6e3e8ea1001b3f46e9635a929758c37acc Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Wed, 14 Aug 2024 16:33:25 -0400 Subject: [PATCH] Move class change handlers to init --- src/index.jsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/index.jsx b/src/index.jsx index bad4fa5f89..51104084d5 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -58,6 +58,14 @@ build: ${__JF_BUILD_VERSION__}`); window.Events = Events; 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 const serverUrl = await serverAddress(); if (serverUrl) { @@ -253,11 +261,3 @@ async function renderApp() { } init(); - -pageClassOn('viewshow', 'standalonePage', function () { - document.querySelector('.skinHeader').classList.add('noHeaderRight'); -}); - -pageClassOn('viewhide', 'standalonePage', function () { - document.querySelector('.skinHeader').classList.remove('noHeaderRight'); -});