From bba3f3000f701677909fa723446100c8990f9976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 17 Sep 2014 13:00:35 +0200 Subject: [PATCH] Search: remove dashboard from search result after dashboard deletion, Closes #753 --- src/app/controllers/search.js | 5 +++-- src/app/partials/search.html | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/controllers/search.js b/src/app/controllers/search.js index 98e6616f0a4..18b860d0ab5 100644 --- a/src/app/controllers/search.js +++ b/src/app/controllers/search.js @@ -119,9 +119,10 @@ function (angular, _, config, $) { $scope.searchDashboards($scope.query.query); }; - $scope.deleteDashboard = function(id, evt) { + $scope.deleteDashboard = function(dash, evt) { evt.stopPropagation(); - $scope.emitAppEvent('delete-dashboard', { id: id }); + $scope.emitAppEvent('delete-dashboard', { id: dash.id }); + $scope.results.dashboards = _.without($scope.results.dashboards, dash); }; $scope.addMetricToCurrentDashboard = function (metricId) { diff --git a/src/app/partials/search.html b/src/app/partials/search.html index e5241e9b11e..ccddfb14474 100644 --- a/src/app/partials/search.html +++ b/src/app/partials/search.html @@ -54,7 +54,7 @@ share     - + delete