From 24acea72617fb2758e71a76c9d55c5bf3478198f Mon Sep 17 00:00:00 2001 From: carl bergquist Date: Thu, 17 Dec 2015 14:41:10 +0100 Subject: [PATCH] refactoring(top_nav): move menu condition to controller --- public/app/features/dashboard/dashboardNavCtrl.js | 4 ++++ .../features/dashboard/partials/dashboardTopNav.html | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/public/app/features/dashboard/dashboardNavCtrl.js b/public/app/features/dashboard/dashboardNavCtrl.js index f367652d0c4..44167d8c4f8 100644 --- a/public/app/features/dashboard/dashboardNavCtrl.js +++ b/public/app/features/dashboard/dashboardNavCtrl.js @@ -20,6 +20,10 @@ function (angular, _) { $location.search(search); }; + $scope.showSettingsMenu = function() { + return $scope.dashboardMeta.canEdit || $scope.contextSrv.isEditor; + }; + $scope.starDashboard = function() { if ($scope.dashboardMeta.isStarred) { backendSrv.delete('/api/user/stars/dashboard/' + $scope.dashboard.id).then(function() { diff --git a/public/app/features/dashboard/partials/dashboardTopNav.html b/public/app/features/dashboard/partials/dashboardTopNav.html index c2e4d75cd95..461650c9d0e 100644 --- a/public/app/features/dashboard/partials/dashboardTopNav.html +++ b/public/app/features/dashboard/partials/dashboardTopNav.html @@ -29,14 +29,14 @@
  • -