You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2016/03/03 13:07:09 UTC

[02/28] ignite git commit: IGNITE-2711 Stop refresh on paragraph remove.

IGNITE-2711 Stop refresh on paragraph remove.


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

Branch: refs/heads/ignite-843-rc3
Commit: 5e3b91912eda5dcb9f5a3afb2811f61cfad152a9
Parents: daccaef
Author: Andrey <an...@gridgain.com>
Authored: Wed Feb 24 16:38:25 2016 +0700
Committer: Andrey <an...@gridgain.com>
Committed: Wed Feb 24 16:38:25 2016 +0700

----------------------------------------------------------------------
 .../src/main/js/controllers/sql-controller.js   | 26 +++++++++++---------
 1 file changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/5e3b9191/modules/control-center-web/src/main/js/controllers/sql-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/sql-controller.js b/modules/control-center-web/src/main/js/controllers/sql-controller.js
index a7abc82..84773b2 100644
--- a/modules/control-center-web/src/main/js/controllers/sql-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/sql-controller.js
@@ -407,23 +407,25 @@ consoleModule.controller('sqlController', function ($http, $timeout, $interval,
     $scope.removeParagraph = function(paragraph) {
         $confirm.confirm('Are you sure you want to remove: "' + paragraph.name + '"?')
             .then(function () {
-                    var paragraph_idx = _.findIndex($scope.notebook.paragraphs, function (item) {
-                        return paragraph == item;
-                    });
+                $scope.stopRefresh(paragraph);
 
-                    var panel_idx = _.findIndex($scope.expandedParagraphs, function (item) {
-                        return paragraph_idx == item;
-                    });
+                var paragraph_idx = _.findIndex($scope.notebook.paragraphs, function (item) {
+                    return paragraph == item;
+                });
+
+                var panel_idx = _.findIndex($scope.expandedParagraphs, function (item) {
+                    return paragraph_idx == item;
+                });
 
-                    if (panel_idx >= 0)
-                        $scope.expandedParagraphs.splice(panel_idx, 1);
+                if (panel_idx >= 0)
+                    $scope.expandedParagraphs.splice(panel_idx, 1);
 
-                    $scope.notebook.paragraphs.splice(paragraph_idx, 1);
+                $scope.notebook.paragraphs.splice(paragraph_idx, 1);
 
-                    $scope.rebuildScrollParagraphs();
+                $scope.rebuildScrollParagraphs();
 
-                    QueryNotebooks.save($scope.demo, $scope.notebook)
-                        .catch(_handleException);
+                QueryNotebooks.save($scope.demo, $scope.notebook)
+                    .catch(_handleException);
             });
     };