diff --git a/lib/persona.js b/lib/persona.js index 1f3ff90..f1a6c05 100644 --- a/lib/persona.js +++ b/lib/persona.js @@ -3,18 +3,25 @@ /*globals ajaxify, config, utils, app, socket, NProgress*/ $(document).ready(function() { - var env = utils.findBootstrapEnvironment(); + $(".navbar-fixed-top").autoHidingNavbar({ + showOnBottom: false, + disableAutohide: true + }); setupNProgress(); setupTaskbar(); setupEditedByIcon(); setupMobileMenu(); setupQuickReply(); + updateAutoHidingNavbar(); - if (env === 'xs' || env ==='sm') { - $(".navbar-fixed-top").autoHidingNavbar({ - showOnBottom: false - }); + $(window).on('resize', function() { + updateAutoHidingNavbar(); + }); + + function updateAutoHidingNavbar() { + var env = utils.findBootstrapEnvironment(); + $(".navbar-fixed-top").autoHidingNavbar('setDisableAutohide', !(env === 'xs' || env ==='sm')); } function setupNProgress() {