diff --git a/src/app/controllers/dashboardNavCtrl.js b/src/app/controllers/dashboardNavCtrl.js index 084d1e215a6..3e3321b7d0d 100644 --- a/src/app/controllers/dashboardNavCtrl.js +++ b/src/app/controllers/dashboardNavCtrl.js @@ -93,12 +93,18 @@ function (angular, _, moment, config, store) { }; $scope.deleteDashboard = function(evt, options) { - if (!confirm('Do you want to delete dashboard ' + options.title + ' ?')) { - return; - } - if (!$scope.isAdmin()) { return false; } + $scope.appEvent('confirm-modal', { + title: 'Delete dashboard', + text: 'Do you want to delete dashboard ' + options.title + '?', + onConfirm: function() { + $scope.deleteDashboardConfirmed(options); + } + }); + }; + + $scope.deleteDashboardConfirmed = function(options) { var id = options.id; $scope.db.deleteDashboard(id).then(function(id) { $scope.appEvent('alert-success', ['Dashboard Deleted', id + ' has been deleted']); diff --git a/src/app/controllers/row.js b/src/app/controllers/row.js index e18529ee519..c92155d8d7e 100644 --- a/src/app/controllers/row.js +++ b/src/app/controllers/row.js @@ -47,9 +47,13 @@ function (angular, app, _) { }; $scope.delete_row = function() { - if (confirm("Are you sure you want to delete this row?")) { - $scope.dashboard.rows = _.without($scope.dashboard.rows, $scope.row); - } + $scope.appEvent('confirm-modal', { + title: 'Delete row', + text: 'Are you sure you want to delete this row?', + onConfirm: function() { + $scope.dashboard.rows = _.without($scope.dashboard.rows, $scope.row); + } + }); }; $scope.move_row = function(direction) { @@ -77,7 +81,8 @@ function (angular, app, _) { $scope.remove_panel_from_row = function(row, panel) { $scope.appEvent('confirm-modal', { - title: 'Are you sure you want to remove this panel?', + title: 'Remove panel', + text: 'Are you sure you want to remove this panel?', onConfirm: function() { row.panels = _.without(row.panels, panel); } diff --git a/src/app/partials/confirm_modal.html b/src/app/partials/confirm_modal.html index 6968fdf82a9..6c954d756bd 100644 --- a/src/app/partials/confirm_modal.html +++ b/src/app/partials/confirm_modal.html @@ -2,17 +2,20 @@
+ {{text}}
+
+
+