Commit e539a6d6 authored by Leo Iannacone's avatar Leo Iannacone

update sticky offset when sidebar gets new contents

parent 77fd9f56
...@@ -113,6 +113,7 @@ function Page_Distrubion(socket) ...@@ -113,6 +113,7 @@ function Page_Distrubion(socket)
$('#packages ul').append('<li class="text-muted">No packages yet</li>') $('#packages ul').append('<li class="text-muted">No packages yet</li>')
} }
packages.show() packages.show()
sticky.updateOffset()
}, },
clean: function () { clean: function () {
$('#packages ul').html('') $('#packages ul').html('')
...@@ -205,6 +206,7 @@ function Page_Distrubion(socket) ...@@ -205,6 +206,7 @@ function Page_Distrubion(socket)
$('#sources').show() $('#sources').show()
} }
files.show() files.show()
sticky.updateOffset()
}, },
clean: function() { clean: function() {
$('#logs ul').html(''); $('#logs ul').html('');
...@@ -313,6 +315,7 @@ function Page_Distrubion(socket) ...@@ -313,6 +315,7 @@ function Page_Distrubion(socket)
sticky.show() sticky.show()
} else { } else {
sticky.hide() sticky.hide()
sticky.updateOffset()
} }
}, },
start: function() { start: function() {
...@@ -339,8 +342,7 @@ function Page_Distrubion(socket) ...@@ -339,8 +342,7 @@ function Page_Distrubion(socket)
$("#sticky-package").fadeOut(150) $("#sticky-package").fadeOut(150)
}, },
update: function() { update: function() {
var sidebar = $("#files") sticky.updateOffset()
sidebarOffset = sidebar.offset().top
if (Utils.check_view_distribution(view)) if (Utils.check_view_distribution(view))
$("#sticky-package .distribution").html(view.distribution.name) $("#sticky-package .distribution").html(view.distribution.name)
if (Utils.check_view_package(view)) { if (Utils.check_view_package(view)) {
...@@ -349,6 +351,10 @@ function Page_Distrubion(socket) ...@@ -349,6 +351,10 @@ function Page_Distrubion(socket)
sticky.set_status() sticky.set_status()
} }
}, },
updateOffset: function() {
var sidebar = $("#files")
sidebarOffset = sidebar.offset().top
},
set_status: function(status_data) { set_status: function(status_data) {
if (! status_data) { if (! status_data) {
status_data = {} status_data = {}
......
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