Skip to content

Commit 33cdec2

Browse files
committed
Updated to lock the navbar on changeMode
1 parent c9f35b9 commit 33cdec2

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

public/js/index.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ function toggleMode() {
550550
}
551551

552552
function changeMode(type) {
553+
lockNavbar();
553554
saveInfo();
554555
if (type)
555556
currentMode = type;
@@ -616,6 +617,16 @@ function changeMode(type) {
616617
ui.toolbar.view.addClass("active");
617618
modeIcon.addClass('fa-toggle-on');
618619
}
620+
unlockNavbar();
621+
}
622+
623+
function lockNavbar() {
624+
$('.navbar').addClass('locked');
625+
}
626+
627+
var unlockNavbar = _.debounce(function () {
628+
$('.navbar').removeClass('locked');
629+
}, 200);
619630
}
620631

621632
//button actions

public/vendor/showup/showup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
target.clearQueue();
3737
target.stop();
3838
var currentScroll = $(this).scrollTop();
39-
if (currentScroll > hideOffset) {
39+
if (currentScroll > hideOffset && !target.hasClass('locked')) {
4040
if(Math.abs(previousScroll - currentScroll) < 50) return;
4141
if (currentScroll > previousScroll) {
4242
// Action on scroll down

0 commit comments

Comments
 (0)