Guard gridController.addRow from setting form state to dirty if invoked from initSection

This commit is contained in:
Gareth Evans
2018-07-20 11:42:52 +12:00
parent b9d7046bbc
commit 88b6f4e436

View File

@@ -333,7 +333,7 @@ angular.module("umbraco")
}
}
$scope.addRow = function (section, layout) {
$scope.addRow = function (section, layout, isInit) {
//copy the selected layout into the rows collection
var row = angular.copy(layout);
@@ -345,8 +345,9 @@ angular.module("umbraco")
if (row) {
section.rows.push(row);
}
currentForm.$setDirty();
if (!isInit) {
currentForm.$setDirty();
}
$scope.showRowConfigurations = false;
@@ -728,7 +729,7 @@ angular.module("umbraco")
if (!section.rows || section.rows.length === 0) {
section.rows = [];
if(section.$allowedLayouts.length === 1){
$scope.addRow(section, section.$allowedLayouts[0]);
$scope.addRow(section, section.$allowedLayouts[0], true);
}
} else {
_.forEach(section.rows, function (row, index) {