feat: added client-size hook to enable configuration of navbar hiding, closes #541

main
Julian Lam 3 years ago
parent e06a537634
commit 758743220d

@ -45,6 +45,8 @@ $(document).ready(function () {
if (!$.fn.autoHidingNavbar) {
return;
}
require(['hooks'], (hooks) => {
var env = utils.findBootstrapEnvironment();
// if env didn't change don't destroy and recreate
if (env === lastBSEnv) {
@ -55,7 +57,10 @@ $(document).ready(function () {
navbarEl.autoHidingNavbar('destroy').removeData('plugin_autoHidingNavbar');
navbarEl.css('top', '');
if (env === 'xs' || env === 'sm') {
hooks.fire('filter:persona.configureNavbarHiding', {
resizeEnvs: ['xs', 'sm'],
}).then(({ resizeEnvs }) => {
if (resizeEnvs.includes(env)) {
navbarEl.autoHidingNavbar({
showOnBottom: false,
});
@ -81,6 +86,8 @@ $(document).ready(function () {
.on('hide.autoHidingNavbar', function () {
fixTopCss('0px');
});
});
});
}
function setupNProgress() {

Loading…
Cancel
Save