Skip to content

Commit 8b04c32

Browse files
Merge branch 'v8/8.10' into v8/8.11
2 parents 0386a31 + fc447bb commit 8b04c32

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-5
lines changed

src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/dialogs/config.controller.js

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,25 @@ function ConfigController($scope) {
1616
$scope.model.close();
1717
}
1818
}
19-
19+
20+
vm.showEmptyState = false;
21+
vm.showConfig = false;
22+
vm.showStyles = false;
23+
24+
$scope.$watchCollection('model.config', onWatch);
25+
$scope.$watchCollection('model.styles', onWatch);
26+
27+
function onWatch() {
28+
29+
vm.showConfig = $scope.model.config &&
30+
($scope.model.config.length > 0 || Object.keys($scope.model.config).length > 0);
31+
vm.showStyles = $scope.model.styles &&
32+
($scope.model.styles.length > 0 || Object.keys($scope.model.styles).length > 0);
33+
34+
vm.showEmptyState = vm.showConfig === false && vm.showStyles === false;
35+
36+
}
37+
2038
}
2139

2240
angular.module("umbraco").controller("Umbraco.PropertyEditors.GridPrevalueEditor.ConfigController", ConfigController);

src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/dialogs/config.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
<umb-editor-container>
1414
<ng-form name="gridItemConfigEditor" val-form-manager>
1515

16-
<umb-empty-state position="center" ng-if="model.config.length === 0 && model.styles.length === 0">
16+
<umb-empty-state position="center" ng-if="vm.showEmptyState">
1717
<localize key="grid_noConfiguration">No further configuration available</localize>
1818
</umb-empty-state>
1919

20-
<umb-box ng-if="model.config && model.config.length > 0">
20+
<umb-box ng-if="vm.showConfig">
2121
<umb-box-header title-key="grid_settings"></umb-box-header>
2222
<umb-box-content>
2323
<div>
@@ -29,7 +29,7 @@
2929
</umb-box-content>
3030
</umb-box>
3131

32-
<umb-box ng-if="model.styles && model.styles.length > 0">
32+
<umb-box ng-if="vm.showStyles">
3333
<umb-box-header title-key="grid_styles"></umb-box-header>
3434
<umb-box-content>
3535
<div>
@@ -52,7 +52,7 @@
5252
shortcut="esc"
5353
action="vm.close()">
5454
</umb-button>
55-
<umb-button ng-if="(model.config && model.config.length > 0) || (model.styles && model.styles.length > 0)"
55+
<umb-button ng-if="vm.showConfig || vm.showStyles"
5656
type="button"
5757
button-style="success"
5858
label-key="general_submit"

0 commit comments

Comments
 (0)