Ghost panel test

This commit is contained in:
Torkel Ödegaard 2015-03-24 19:42:39 +01:00
parent 7919d79347
commit cc71b1f07d
3 changed files with 6 additions and 5 deletions

View File

@ -81,13 +81,13 @@ function (angular, app, _, config) {
$scope.$broadcast('render');
};
$scope.remove_panel_from_row = function(row, panel) {
$scope.removePanel = function(panel) {
$scope.appEvent('confirm-modal', {
title: 'Are you sure you want to remove this panel?',
icon: 'fa-trash',
yesText: 'Delete',
onConfirm: function() {
row.panels = _.without(row.panels, panel);
$scope.row.panels = _.without($scope.row.panels, panel);
}
});
};

View File

@ -20,9 +20,9 @@ function (angular, $, _) {
var template = '<div class="panel-menu small">';
template += '<div class="panel-menu-inner">';
template += '<div class="panel-menu-row">';
template += '<a class="panel-menu-icon pull-left" ng-click="updateColumnSpan(-1)"><i class="fa fa-minus"></i></a>';
template += '<a class="panel-menu-icon pull-left" ng-click="updateColumnSpan(1)"><i class="fa fa-plus"></i></a>';
template += '<a class="panel-menu-icon pull-right" ng-click="remove_panel_from_row(row, panel)"><i class="fa fa-remove"></i></a>';
template += '<a class="panel-menu-icon pull-left" ng-click="updateColumnSpan(panel,-1)"><i class="fa fa-minus"></i></a>';
template += '<a class="panel-menu-icon pull-left" ng-click="updateColumnSpan(panel,1)"><i class="fa fa-plus"></i></a>';
template += '<a class="panel-menu-icon pull-right" ng-click="removePanel(panel)"><i class="fa fa-remove"></i></a>';
template += '<div class="clearfix"></div>';
template += '</div>';

View File

@ -41,6 +41,7 @@ function (angular, _, config) {
$scope.updateColumnSpan = function(span) {
$scope.panel.span = Math.min(Math.max($scope.panel.span + span, 1), 12);
$scope.row.updatePanelSpan()
$timeout(function() {
$scope.$broadcast('render');