Skip to content

Commit

Permalink
Update src/perfect_scrollbar.js
Browse files Browse the repository at this point in the history
Ensure the panel is at the top after an update where the scroll bars
are removed. Other wise it is possible to get stuck midway down a panel
with no way of scrolling.
  • Loading branch information
davidkethel committed Feb 7, 2013
1 parent b169654 commit 6b2a625
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/perfect-scrollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
else {
scrollbar_x_width = 0;
scrollbar_x_left = 0;
$this.scrollLeft(0);
}
if(container_height < content_height) {
scrollbar_y_height = parseInt(container_height * container_height / content_height);
Expand All @@ -68,6 +69,7 @@
else {
scrollbar_y_height = 0;
scrollbar_y_left = 0;
$this.scrollTop(0);
}

$scrollbar_x.css({left: scrollbar_x_left + $this.scrollLeft(), bottom: scrollbar_x_bottom - $this.scrollTop(), width: scrollbar_x_width});
Expand Down

0 comments on commit 6b2a625

Please sign in to comment.