Browse Source

Force preserve scrolling position

Pierre-Olivier Latour 11 years ago
parent
commit
252c38c42a
1 changed files with 2 additions and 0 deletions
  1. 2 0
      GCDWebUploader/GCDWebUploader.bundle/js/index.js

+ 2 - 0
GCDWebUploader/GCDWebUploader.bundle/js/index.js

@@ -78,6 +78,7 @@ function _reload(path) {
   }).fail(function(jqXHR, textStatus, errorThrown) {
   }).fail(function(jqXHR, textStatus, errorThrown) {
     _showError("Failed retrieving contents of \"" + path + "\"", textStatus, errorThrown);
     _showError("Failed retrieving contents of \"" + path + "\"", textStatus, errorThrown);
   }).done(function(data, textStatus, jqXHR) {
   }).done(function(data, textStatus, jqXHR) {
+    var scrollPosition = $(document).scrollTop();
     
     
     if (path != _path) {
     if (path != _path) {
       $("#path").empty();
       $("#path").empty();
@@ -169,6 +170,7 @@ function _reload(path) {
       });
       });
     });
     });
     
     
+    $(document).scrollTop(scrollPosition);
   }).always(function() {
   }).always(function() {
     _enableReloads();
     _enableReloads();
   });
   });