Merge pull request #1492 from jswietek/U4-8975

U4 8975
This commit is contained in:
Claus
2016-10-05 10:51:14 +02:00
committed by GitHub
4 changed files with 28 additions and 7 deletions

View File

@@ -16,7 +16,7 @@ angular.module("umbraco")
};
$scope.scaleDown = function(section){
var remove = (section.grid > 1) ? 1 : section.grid;
var remove = (section.grid > 1) ? 1 : 0;
section.grid = section.grid-remove;
};
@@ -49,9 +49,12 @@ angular.module("umbraco")
$scope.currentSection = section;
};
$scope.deleteSection = function(index){
$scope.currentTemplate.sections.splice(index, 1);
$scope.deleteSection = function(section, template) {
if ($scope.currentSection === section) {
$scope.currentSection = undefined;
}
var index = template.sections.indexOf(section)
template.sections.splice(index, 1);
};
$scope.closeSection = function(){

View File

@@ -46,6 +46,13 @@
</div>
</umb-control-group>
<umb-control-group hide-label="true">
<i class="icon-delete red"></i>
<a class="btn btn-small btn-link" href="" ng-click="deleteSection(currentSection, currentLayout)">
<localize key="general_delete" class="ng-isolate-scope ng-scope">Delete</localize>
</a>
</umb-control-group>
<umb-control-group hide-label="true">
<ul class="unstyled">

View File

@@ -14,7 +14,7 @@ function RowConfigController($scope) {
};
$scope.scaleDown = function(section) {
var remove = (section.grid > 1) ? 1 : section.grid;
var remove = (section.grid > 1) ? 1 : 0;
section.grid = section.grid - remove;
};
@@ -58,9 +58,14 @@ function RowConfigController($scope) {
}
};
$scope.deleteArea = function(index) {
$scope.currentRow.areas.splice(index, 1);
$scope.deleteArea = function (cell, row) {
if ($scope.currentCell === cell) {
$scope.currentCell = undefined;
}
var index = row.areas.indexOf(cell)
row.areas.splice(index, 1);
};
$scope.closeArea = function() {
$scope.currentCell = undefined;
};

View File

@@ -57,6 +57,12 @@
</div>
</umb-control-group>
<umb-control-group hide-label="true">
<i class="icon-delete red"></i>
<a class="btn btn-small btn-link" href="" ng-click="deleteArea(currentCell, currentRow)">
<localize key="general_delete" class="ng-isolate-scope ng-scope">Delete</localize>
</a>
</umb-control-group>
<umb-control-group hide-label="true">
<ul class="unstyled">