cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pran...@apache.org
Subject git commit: updated refs/heads/master to a9f0fb8
Date Sat, 04 May 2013 20:28:26 GMT
Updated Branches:
  refs/heads/master 5811ae7e2 -> a9f0fb800


CLOUDSTACK-2076:Listview widget infinte scrolling error


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a9f0fb80
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a9f0fb80
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a9f0fb80

Branch: refs/heads/master
Commit: a9f0fb800929638718271be70a0bf9ecf49643f2
Parents: 5811ae7
Author: Isaac Chiang <isaacchiang@gmail.com>
Authored: Sun May 5 01:57:35 2013 +0530
Committer: Pranav Saxena <pranav.saxena@citrix.com>
Committed: Sun May 5 01:57:35 2013 +0530

----------------------------------------------------------------------
 ui/scripts/ui/widgets/listView.js |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a9f0fb80/ui/scripts/ui/widgets/listView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js
index f368951..0d5ef6fc 100644
--- a/ui/scripts/ui/widgets/listView.js
+++ b/ui/scripts/ui/widgets/listView.js
@@ -1687,6 +1687,9 @@
       return false;
     });		
 				
+    var tableHeight = $table.height();
+    var endTable = false;
+
     // Infinite scrolling event
     $listView.bind('scroll', function(event) {
       if (args.listView && args.listView.disableInfiniteScrolling) return false;
@@ -1697,7 +1700,7 @@
         var loadMoreData = $listView.scrollTop() >= ($table.height() - $listView.height())
- $listView.height() / 4;
         var context = $listView.data('view-args').context;
 
-        if (loadMoreData) {
+        if (loadMoreData && !endTable) {
           page = page + 1;
 					
 					var filterBy = {
@@ -1725,6 +1728,7 @@
             reorder: listViewData.reorder,
             detailView: listViewData.detailView
           });
+          $table.height() == tableHeight ? endTable = true : tableHeight = $table.height();
         }
       }, 500);
 


Mime
View raw message