ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anovi...@apache.org
Subject incubator-ignite git commit: # ignite-843 WIP.
Date Tue, 02 Jun 2015 09:27:45 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-843 14490724f -> af6f65db7


# ignite-843 WIP.


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

Branch: refs/heads/ignite-843
Commit: af6f65db766ccb66e6547916b5e18937202ca46c
Parents: 1449072
Author: Andrey <anovikov@gridgain.com>
Authored: Tue Jun 2 16:27:36 2015 +0700
Committer: Andrey <anovikov@gridgain.com>
Committed: Tue Jun 2 16:27:36 2015 +0700

----------------------------------------------------------------------
 .../public/javascripts/controllers/clusters.js       | 15 +++++----------
 modules/webconfig/nodejs/views/clusters.jade         |  2 +-
 2 files changed, 6 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af6f65db/modules/webconfig/nodejs/public/javascripts/controllers/clusters.js
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/public/javascripts/controllers/clusters.js b/modules/webconfig/nodejs/public/javascripts/controllers/clusters.js
index 51b9fe9..e1083ff 100644
--- a/modules/webconfig/nodejs/public/javascripts/controllers/clusters.js
+++ b/modules/webconfig/nodejs/public/javascripts/controllers/clusters.js
@@ -79,18 +79,13 @@ configuratorModule.controller('clustersController', ['$scope', '$modal',
'$http'
                 });
         };
 
-        // Remove new cluster.
-        $scope.removeItem = function(_id) {
-            $http.post('/rest/clusters/remove', {_id: _id})
+        $scope.removeItem = function(row) {
+            $http.post('/rest/clusters/remove', {_id: row._id})
                 .success(function(data) {
-                    for (var i = 0; i < $scope.clusters.length; i++) {
-                        if ($scope.clusters[i]._id == _id) {
-                            $scope.clusters.slice(i, 1);
-
-                            break;
-                        }
-                    }
+                    var index = $scope.clusters.indexOf(row);
 
+                    if (index !== -1)
+                        $scope.clusters.splice(index, 1);
                 })
                 .error(function(errorMessage) {
                     console.log('Error: ' + errorMessage);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/af6f65db/modules/webconfig/nodejs/views/clusters.jade
----------------------------------------------------------------------
diff --git a/modules/webconfig/nodejs/views/clusters.jade b/modules/webconfig/nodejs/views/clusters.jade
index 4dceaa7..4edf2d4 100644
--- a/modules/webconfig/nodejs/views/clusters.jade
+++ b/modules/webconfig/nodejs/views/clusters.jade
@@ -32,7 +32,7 @@ block content
                     tr.col-xs-12(ng-repeat='row in rowCollection')
                         td.col-xs-12(ng-class="{active: row == selectedCluster}")
                             a(ng-click='selectItem(row)') Name: {{row.name}}, Discovery:
{{discoveryAsString(row.discovery.kind)}}
-                            span.pull-right(type='button' st-custom-action callback='removeItem(row._id)')
+                            span.pull-right(type='button' ng-click='removeItem(row)')
                                 i(class=['fa', 'fa-remove'])
         .settings-row
             button(ng-click='createItem()' class=['btn', 'btn-default'] ng-disabled='!create.template')
&nbspAdd cluster...


Mime
View raw message