Commit 22211452 authored by Leo Iannacone's avatar Leo Iannacone

Merge remote-tracking branch 'github/master' into portable

parents 0a22befd 8ee5d4fb
...@@ -88,19 +88,23 @@ function Page_Distrubion(socket) { ...@@ -88,19 +88,23 @@ function Page_Distrubion(socket) {
var page = { var page = {
go: { go: {
down: function (height) { down: function (height, delay) {
if (height === undefined) if (height === undefined)
height = $('body').offset().top; height = $('body').height();
if (delay === undefined)
delay = 0;
debug(2, 'scrolling page down - height', height); debug(2, 'scrolling page down - height', height);
$('html,body').animate({ $('html,body').animate({
scrollTop: height scrollTop: height
}, 0); }, 0);
}, },
up: function () { up: function (delay) {
if (delay === undefined)
delay = 0;
debug(2, 'scrolling page up'); debug(2, 'scrolling page up');
$('html,body').animate({ $('html,body').animate({
scrollTop: 0 scrollTop: 0
}, 0); }, delay);
} }
} }
}; };
...@@ -701,7 +705,9 @@ function Page_Distrubion(socket) { ...@@ -701,7 +705,9 @@ function Page_Distrubion(socket) {
populate(); populate();
// Init sticky-package back_on_top on click // Init sticky-package back_on_top on click
$('#sticky-package').on('click', page.go.up); $('#sticky-package').on('click', function () {
page.go.up(100);
});
// WORKAROUND: // WORKAROUND:
// when page is loaded sidebar has offset().top // when page is loaded sidebar has offset().top
......
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