cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alena1...@apache.org
Subject [16/43] git commit: updated refs/heads/internallb to c773d20
Date Wed, 01 May 2013 20:40:52 GMT
Fix remove NIC UI behavior


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

Branch: refs/heads/internallb
Commit: c02a4b9c7f501f1e50082cbb7847ee2dc820411b
Parents: b7b7753
Author: Brian Federle <brian.federle@citrix.com>
Authored: Fri Apr 26 13:42:56 2013 -0700
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Fri Apr 26 13:42:56 2013 -0700

----------------------------------------------------------------------
 ui/scripts/instances.js             |    2 +-
 ui/scripts/ui/widgets/detailView.js |   39 +++++++++++++++++------------
 2 files changed, 24 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c02a4b9c/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index f30e8d3..a3b8abb 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -1491,7 +1491,7 @@
               },
 
               // Remove NIC/Network from VM
-              destroy: {
+              remove: {
                 label: 'label.action.delete.nic',
                 messages: {
                   confirm: function(args) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c02a4b9c/ui/scripts/ui/widgets/detailView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/detailView.js b/ui/scripts/ui/widgets/detailView.js
index 0b16d2d..ea6c3a2 100644
--- a/ui/scripts/ui/widgets/detailView.js
+++ b/ui/scripts/ui/widgets/detailView.js
@@ -302,29 +302,36 @@
     },
 
     remove: function($detailView, args) {
+      var tab = args.tabs[args.activeTab];
+      var isMultiple = tab.multiple;
+
       uiActions.standard($detailView, args, {
         noRefresh: true,
         complete: function(args) {
-          var $browser = $('#browser .container');
-          var $panel = $detailView.closest('.panel');
+          if (isMultiple) {
+            $detailView.find('.refresh').click(); // Reload tab
+          } else {
+            var $browser = $('#browser .container');
+            var $panel = $detailView.closest('.panel');
 
-          if ($detailView.is(':visible')) {
-            $browser.cloudBrowser('selectPanel', {
-              panel: $panel.prev()
-            });
-          }
+            if ($detailView.is(':visible')) {
+              $browser.cloudBrowser('selectPanel', {
+                panel: $panel.prev()
+              });
+            }
 
-          if($detailView.data("list-view-row") != null) {
-            var $row = $detailView.data('list-view-row');
-            var $tbody = $row.closest('tbody');
+            if($detailView.data("list-view-row") != null) {
+              var $row = $detailView.data('list-view-row');
+              var $tbody = $row.closest('tbody');
 
-            $row.remove();
-            if(!$tbody.find('tr').size()) {
-              $("<tr>").addClass('empty').append(
-                $("<td>").html(_l('label.no.data'))
-              ).appendTo($tbody);
+              $row.remove();
+              if(!$tbody.find('tr').size()) {
+                $("<tr>").addClass('empty').append(
+                  $("<td>").html(_l('label.no.data'))
+                ).appendTo($tbody);
+              }
+              $tbody.closest('table').dataTable('refresh');
             }
-            $tbody.closest('table').dataTable('refresh');
           }
         }
       });


Mime
View raw message