set a no disposable unique row ID for row styling

This commit is contained in:
antoine
2014-10-01 12:56:45 +02:00
parent 45dde8717b
commit 371e4382cb

View File

@@ -207,13 +207,18 @@ angular.module("umbraco")
};
$scope.addRow = function (section, layout) {
//copy the selected layout into the rows collection
var row = angular.copy(layout);
// Init row value
row = $scope.initRow(row);
// Push the new row
if(row){
section.rows.push(row);
}
};
$scope.removeRow = function (section, $index) {
@@ -460,6 +465,10 @@ angular.module("umbraco")
//set a disposable unique ID
original.$uniqueId = $scope.setUniqueId();
//set a no disposable unique ID (util for row styling)
original.id = !row.id ? $scope.setUniqueId() : row.id;
return original;
}