Skip to content

Commit

Permalink
Added media query to determine if header should auto hide
Browse files Browse the repository at this point in the history
  • Loading branch information
pjerlvi committed Dec 18, 2017
1 parent d71d19e commit 377fbfd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
4 changes: 4 additions & 0 deletions less/header.less
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@
margin-left: -30px;
}
}

@media (min-width: @screen-md-min) {
top: 0px !important;
}
}

.breadcrumb {
Expand Down
15 changes: 3 additions & 12 deletions lib/persona.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,18 @@
/*globals ajaxify, config, utils, app, socket, NProgress*/

$(document).ready(function() {
$(".navbar-fixed-top").autoHidingNavbar({
showOnBottom: false,
disableAutohide: true
});
var env = utils.findBootstrapEnvironment();

setupNProgress();
setupTaskbar();
setupEditedByIcon();
setupMobileMenu();
setupQuickReply();
updateAutoHidingNavbar();

$(window).on('resize', function() {
updateAutoHidingNavbar();
$(".navbar-fixed-top").autoHidingNavbar({
showOnBottom: false
});

function updateAutoHidingNavbar() {
var env = utils.findBootstrapEnvironment();
$(".navbar-fixed-top").autoHidingNavbar('setDisableAutohide', !(env === 'xs' || env ==='sm'));
}

function setupNProgress() {
$(window).on('action:ajaxify.start', function() {
NProgress.set(0.7);
Expand Down

0 comments on commit 377fbfd

Please sign in to comment.