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) { ...@@ -503,7 +503,7 @@ function Page_Distrubion(socket) {
init: function () { init: function () {
if (sidebarOffset === 0) if (sidebarOffset === 0)
return; return;
if ($(window).scrollTop() > sidebarOffset) { if ($(window).scrollTop() > sidebarOffset && $('#main').height() > $('#sticky').height()) {
sticky.show(); sticky.show();
} else { } else {
sticky.hide(); sticky.hide();
...@@ -523,11 +523,16 @@ function Page_Distrubion(socket) { ...@@ -523,11 +523,16 @@ function Page_Distrubion(socket) {
sticky.start(); sticky.start();
}, },
show: function () { show: function () {
$('#sticky-package').fadeIn();
if (config.preferences.sidebar) { 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'); $('#sticky').addClass('fixed');
} }
debug(2, 'showing sticky');
$('#sticky-package').fadeIn();
}, },
hide: function () { hide: function () {
$('#sticky').removeClass('fixed'); $('#sticky').removeClass('fixed');
......
...@@ -77,6 +77,7 @@ aside#sidebar .fixed { ...@@ -77,6 +77,7 @@ aside#sidebar .fixed {
position: fixed; position: fixed;
min-width: 220px !important; min-width: 220px !important;
top: 0; top: 0;
overflow: auto;
} }
#sticky-package { #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