From dacb601f9f3b2cda7d26a6902c1d5edf70c36e4c Mon Sep 17 00:00:00 2001 From: David Date: Thu, 7 Feb 2013 14:29:44 +1000 Subject: [PATCH] Update src/perfect_scrollbar.js 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. --- src/perfect-scrollbar.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/perfect-scrollbar.js b/src/perfect-scrollbar.js index 24ea77d..d8ba779 100644 --- a/src/perfect-scrollbar.js +++ b/src/perfect-scrollbar.js @@ -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); @@ -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});