admin nav left menu scroll bug fixed (#784)

* admin nav left menu scroll bug fixed

* scroller

* scroller

* fixed syntax for PR #784
This commit is contained in:
Prateek Srivastava 2019-04-02 18:26:31 +05:30 committed by Jitendra Singh
parent b72c5ab631
commit f2e4930e8e
3 changed files with 37 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/admin.js": "/js/admin.js?id=80929525e1dbb0ab9cd1",
"/js/admin.js": "/js/admin.js?id=f242782bc689d99050dd",
"/css/admin.css": "/css/admin.css?id=a71a72c31d6ac0fe375f"
}
}

View File

@ -9,6 +9,39 @@ Vue.prototype.$http = axios
window.eventBus = new Vue();
window.onload = function () {
moveDistance = 30;
navbarLeftCssTop = parseInt($('.navbar-left').css("top"));
windowHeight = $(window).height();
menubarHeight = $('ul.menubar').height();
documentHeight = $(document).height();
differenceInHeight = menubarHeight - windowHeight;
scrollTopWhenWindowLoaded = $(document).scrollTop();
$('.navbar-left').css('top', -scrollTopWhenWindowLoaded + 60 + 'px');
$(document).ready(function() {
if (menubarHeight > documentHeight && menubarHeight > windowHeight) {
$('.inner-section').css("position","fixed");
$('.navbar-left').css("position","absolute");
} else {
if (scrollTopWhenWindowLoaded > differenceInHeight) {
$('.navbar-left').css('top', -differenceInHeight + 'px');
}
if (menubarHeight > windowHeight) {
$(document).scroll(function() {
documentScrollWhenScrolled = $(document).scrollTop();
if (documentScrollWhenScrolled <= differenceInHeight + 70) {
$('.navbar-left').css('top', -documentScrollWhenScrolled + 60 + 'px');
scrollTopValueWhenNavBarFixed = $(document).scrollTop();
}
});
}
}
});
};
$(document).ready(function () {
Vue.config.ignoredElements = [
'option-wrapper',
@ -94,4 +127,4 @@ $(document).ready(function () {
}
}
});
});
});