Commit 4c5e8967 authored by Leo Iannacone's avatar Leo Iannacone

correctly resize sidebare when add stickybar - closes #7

parent 3741370d
......@@ -503,7 +503,7 @@ function Page_Distrubion(socket) {
init: function () {
if (sidebarOffset === 0)
return;
if ($(window).scrollTop() > sidebarOffset) {
if ($(window).scrollTop() > sidebarOffset && $('#main').height() > $('#sticky').height()) {
sticky.show();
} else {
sticky.hide();
......@@ -523,11 +523,16 @@ function Page_Distrubion(socket) {
sticky.start();
},
show: function () {
$('#sticky-package').fadeIn();
if (config.preferences.sidebar) {
debug(2, 'showing sticky');
if ($(window).height() < $('#sticky').height()) {
var size = $("#sticky-package").position().top;
debug(2, 'sticky too tall - resizing', size);
$('#sticky').height(size);
}
$('#sticky').addClass('fixed');
}
debug(2, 'showing sticky');
$('#sticky-package').fadeIn();
},
hide: function () {
$('#sticky').removeClass('fixed');
......
......@@ -77,6 +77,7 @@ aside#sidebar .fixed {
position: fixed;
min-width: 220px !important;
top: 0;
overflow: auto;
}
#sticky-package {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment