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'); -});