Updated Branches:
  refs/heads/master 7bdf541bd -> efde50fa1

CLOUDSTACK-4092: UI > listView widget: fix a bug that a grid row was 
incorrectly removed when a non-add action of listView failed.


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

Branch: refs/heads/master
Commit: efde50fa1ec74b43681377bcbcd6e94aed41d83e
Parents: 7bdf541
Author: Jessica Wang <jessicaw...@apache.org>
Authored: Wed Aug 7 11:06:04 2013 -0700
Committer: Jessica Wang <jessicaw...@apache.org>
Committed: Wed Aug 7 11:09:40 2013 -0700

----------------------------------------------------------------------
 ui/scripts/ui/widgets/listView.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/efde50fa/ui/scripts/ui/widgets/listView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/listView.js 
b/ui/scripts/ui/widgets/listView.js
index 6b44d99..0745c41 100644
--- a/ui/scripts/ui/widgets/listView.js
+++ b/ui/scripts/ui/widgets/listView.js
@@ -20,7 +20,9 @@
 (function($, cloudStack, _l, _s) {
     var uiActions = {
         standard: function($instanceRow, args, additional) {
-            var listViewArgs = 
$instanceRow.closest('div.list-view').data('view-args');
+               var isAddAction = args.action.isAdd;
+                               
+               var listViewArgs = 
$instanceRow.closest('div.list-view').data('view-args');
             var notification = args.action.notification ? 
args.action.notification : {};
             var messages = args.action ? args.action.messages : {};
             var preAction = args.action ? args.action.preAction : {};
@@ -254,7 +256,7 @@
 
                                     function(errorArgs) {
                                         if (!isHeader) {
-                                            if 
($instanceRow.data('list-view-new-item')) {
+                                            if (isAddAction == true && 
$instanceRow.data('list-view-new-item')) {
                                                 // For create forms
                                                 $instanceRow.remove();
                                             } else {
@@ -702,7 +704,7 @@
 
         // Actions column
         var actionsArray = actions ? $.map(actions, function(v, k) {
-            if (k == 'add') {
+            if (k == 'add' || k == 'rootAdminAddGuestNetwork') {
                 v.isAdd = true;
             }
 

Reply via email to