Commit 9185c94a by ubhatnagar

Added insert row option in the row menu.

parent 14f3a682
......@@ -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);
......
......@@ -69,6 +69,13 @@
<li>
<a dash-editor-link="app/partials/roweditor.html">Row editor</a>
</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>
<a ng-click="delete_row()">Delete row</a>
</li>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment