From 8d1306e6fcd364cc3e0eadc3adfe54c18e8dd3ce Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 19 Sep 2022 14:29:16 -0400 Subject: [PATCH] feat: use new hooks introduced by nodebb/nodebb#10907 --- public/persona.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/public/persona.js b/public/persona.js index ddc6580..2d58694 100644 --- a/public/persona.js +++ b/public/persona.js @@ -57,6 +57,16 @@ $(document).ready(function () { navbarEl.autoHidingNavbar('destroy').removeData('plugin_autoHidingNavbar'); navbarEl.css('top', ''); + hooks + .on('filter:navigator.scroll', (data) => { + navbarEl.autoHidingNavbar('setDisableAutohide', true); + return data; + }) + .on('action:navigator.scrolled', () => { + console.warn('reenabling', navbarEl); + navbarEl.autoHidingNavbar('setDisableAutohide', false); + }); + hooks.fire('filter:persona.configureNavbarHiding', { resizeEnvs: preference, }).then(({ resizeEnvs }) => {