Updated to lock the navbar on changeMode

This commit is contained in:
Wu Cheng-Han 2015-09-24 13:55:02 +08:00
parent c9f35b9aa0
commit 33cdec2fd4
2 changed files with 12 additions and 1 deletions

View file

@ -550,6 +550,7 @@ function toggleMode() {
}
function changeMode(type) {
lockNavbar();
saveInfo();
if (type)
currentMode = type;
@ -616,6 +617,16 @@ function changeMode(type) {
ui.toolbar.view.addClass("active");
modeIcon.addClass('fa-toggle-on');
}
unlockNavbar();
}
function lockNavbar() {
$('.navbar').addClass('locked');
}
var unlockNavbar = _.debounce(function () {
$('.navbar').removeClass('locked');
}, 200);
}
//button actions

View file

@ -36,7 +36,7 @@
target.clearQueue();
target.stop();
var currentScroll = $(this).scrollTop();
if (currentScroll > hideOffset) {
if (currentScroll > hideOffset && !target.hasClass('locked')) {
if(Math.abs(previousScroll - currentScroll) < 50) return;
if (currentScroll > previousScroll) {
// Action on scroll down