mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Added insert row option in the row menu.
This commit is contained in:
parent
14f3a68215
commit
9185c94a2d
@ -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) {
|
$scope.add_panel_default = function(type) {
|
||||||
var defaultSpan = 12;
|
var defaultSpan = 12;
|
||||||
var _as = 12 - $scope.dashboard.rowSpan($scope.row);
|
var _as = 12 - $scope.dashboard.rowSpan($scope.row);
|
||||||
|
@ -69,6 +69,13 @@
|
|||||||
<li>
|
<li>
|
||||||
<a dash-editor-link="app/partials/roweditor.html">Row editor</a>
|
<a dash-editor-link="app/partials/roweditor.html">Row editor</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="dropdown-submenu">
|
||||||
|
<a href="javascript:void(0);">Insert Row</a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
<li><a ng-click="insert_row(0)">Above</a></li>
|
||||||
|
<li><a ng-click="insert_row(1)">Below</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a ng-click="delete_row()">Delete row</a>
|
<a ng-click="delete_row()">Delete row</a>
|
||||||
</li>
|
</li>
|
||||||
|
Loading…
Reference in New Issue
Block a user