diff --git a/src/app/features/dashboard/playlistCtrl.js b/src/app/features/dashboard/playlistCtrl.js index 357663b722d..50440c5912b 100644 --- a/src/app/features/dashboard/playlistCtrl.js +++ b/src/app/features/dashboard/playlistCtrl.js @@ -27,15 +27,24 @@ function (angular, _, config) { $scope.db.searchDashboards(query).then(function(results) { $scope.searchHits = results.dashboards; + $scope.filterHits(); + }); + }; + + $scope.filterHits = function() { + $scope.filteredHits = _.reject($scope.searchHits, function(dash) { + return _.findWhere($scope.playlist, {slug: dash.slug}); }); }; $scope.addDashboard = function(dashboard) { $scope.playlist.push(dashboard); + $scope.filterHits(); }; $scope.removeDashboard = function(dashboard) { $scope.playlist = _.without($scope.playlist, dashboard); + $scope.filterHits(); }; $scope.start = function() { diff --git a/src/app/partials/playlist.html b/src/app/partials/playlist.html index 05d0422771b..38fd552d43b 100644 --- a/src/app/partials/playlist.html +++ b/src/app/partials/playlist.html @@ -36,7 +36,7 @@
- + @@ -65,11 +65,6 @@ - - -
{{dashboard.title}}
- No dashboards found -