cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject [11/50] [abbrv] git commit: updated refs/heads/ui-restyle to c64bfa5
Date Thu, 20 Feb 2014 19:17:17 GMT
CLOUDSTACK-6120: UI > listView widget > sorting order > fire only one sorting API
call(updateXXXXXXX&sortKey=n&id=UUID) for items who have the same UUID.
e.g. An Template/ISO of multiple zones have the same UUID.


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

Branch: refs/heads/ui-restyle
Commit: e1e16a2301a75c6746bdb69774a6d9fb996455ca
Parents: 443acac
Author: Jessica Wang <jessicawang@apache.org>
Authored: Fri Feb 14 12:55:53 2014 -0800
Committer: Jessica Wang <jessicawang@apache.org>
Committed: Fri Feb 14 12:55:53 2014 -0800

----------------------------------------------------------------------
 ui/scripts/ui/widgets/listView.js | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e1e16a23/ui/scripts/ui/widgets/listView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/listView.js b/ui/scripts/ui/widgets/listView.js
index cb4544c..daf86ff 100644
--- a/ui/scripts/ui/widgets/listView.js
+++ b/ui/scripts/ui/widgets/listView.js
@@ -1180,8 +1180,17 @@
                                 if (actionName == 'moveDrag') return false;
 
                                 rowActions[actionName]($tr);
+                                var map1 = {};
                                 $tr.closest('tbody').find('tr').each(function() {
+                                	/* 
+                                	 * fire only one sorting API call(updateXXXXXXX&sortKey=n&id=UUID)
for items who have the same UUID. 
+                                	 * e.g. An Template/ISO of multiple zones have the same
UUID.
+                                	 */
+                                	var objId = $(this).data('json-obj').id;
+                                	if(!(objId in map1)) { 
                                     sort($(this), action);
+                                		map1[objId] = 1;
+                                	}                                       
                                 });
                                 $tr.closest('.data-table').dataTable('selectRow', $tr.index());
 
@@ -1203,7 +1212,15 @@
                             rowActions._std($tr, function() {});
 
                             $tr.closest('tbody').find('tr').each(function() {
+                            	/* 
+                            	 * fire only one sorting API call(updateXXXXXXX&sortKey=n&id=UUID)
for items who have the same UUID. 
+                            	 * e.g. An Template/ISO of multiple zones have the same UUID.
+                            	 */
+                            	var objId = $(this).data('json-obj').id;
+                            	if(!(objId in map1)) { 
                                 sort($(this), reorder.moveDrag);
+                            	    map1[objId] = 1;
+                            	}
                             });
                         }
                     });


Mime
View raw message