diff --git a/public/app/features/dashboard/rowCtrl.js b/public/app/features/dashboard/rowCtrl.js index 02cb59721a3..9b5de4c0a1b 100644 --- a/public/app/features/dashboard/rowCtrl.js +++ b/public/app/features/dashboard/rowCtrl.js @@ -82,6 +82,16 @@ function (angular, _, config) { } }; + $scope.insert_row = function(direction) { + var rowsList = $scope.dashboard.rows; + var currentRowIndex = _.indexOf(rowsList, $scope.row); + $scope.add_row_default(); + var newIndex = currentRowIndex + direction; + if (newIndex >= 0 && newIndex <= (rowsList.length - 1)) { + _.move(rowsList, rowsList.length - 1, newIndex); + } + }; + $scope.add_panel_default = function(type) { var defaultSpan = 12; var _as = 12 - $scope.dashboard.rowSpan($scope.row); diff --git a/public/app/partials/dashboard.html b/public/app/partials/dashboard.html index 4edbb816eeb..668363b111c 100644 --- a/public/app/partials/dashboard.html +++ b/public/app/partials/dashboard.html @@ -69,6 +69,13 @@