Skip to content

Commit

Permalink
Fixing #401
Browse files Browse the repository at this point in the history
Resolving regression caused by #393, and re-introduced original
resize handler method used by @petergood -- placing it behind
lodash .debounce should appease @pitaj's concerns, but I frankly
see no other way to have this feature but also fix cases where
the header is not at the top of the page.
  • Loading branch information
julianlam committed Jan 16, 2018
1 parent fd730df commit 3f43ec1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
4 changes: 0 additions & 4 deletions less/header.less
Expand Up @@ -242,10 +242,6 @@
margin-left: -30px;
}
}

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

.breadcrumb {
Expand Down
18 changes: 16 additions & 2 deletions lib/persona.js
Expand Up @@ -8,11 +8,25 @@ $(document).ready(function() {
setupEditedByIcon();
setupMobileMenu();
setupQuickReply();
configureNavbarHiding();

$(".navbar-fixed-top").autoHidingNavbar({
showOnBottom: false
require(['lodash'], function (_) {
$(window).on('resize', _.debounce(configureNavbarHiding, 200));
});

function configureNavbarHiding () {
var navbarEl = $(".navbar-fixed-top");
navbarEl.autoHidingNavbar('destroy');
navbarEl.css('top', '');

var env = utils.findBootstrapEnvironment();
if (env === 'xs' || env ==='sm') {
navbarEl.autoHidingNavbar({
showOnBottom: false,
});
}
};

function setupNProgress() {
$(window).on('action:ajaxify.start', function() {
NProgress.set(0.7);
Expand Down
12 changes: 6 additions & 6 deletions yarn.lock
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


pulling@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/pulling/-/pulling-1.1.0.tgz#d1460833b623fedcb73c71efb4cbb6824d990749"
pulling@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/pulling/-/pulling-1.1.1.tgz#948c72ec75d76c4ff41d6cec1ef1208c8d9d18f6"

striptags@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/striptags/-/striptags-3.1.0.tgz#763e534338d9cf542f004a4b1eb099e32d295e44"
striptags@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/striptags/-/striptags-3.1.1.tgz#c8c3e7fdd6fb4bb3a32a3b752e5b5e3e38093ebd"

0 comments on commit 3f43ec1

Please sign in to comment.