File tree Expand file tree Collapse file tree 2 files changed +23
-5
lines changed
src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/dialogs Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Original file line number Diff line number Diff 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
2240angular . module ( "umbraco" ) . controller ( "Umbraco.PropertyEditors.GridPrevalueEditor.ConfigController" , ConfigController ) ;
Original file line number Diff line number Diff line change 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 >
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 >
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 "
You can’t perform that action at this time.
0 commit comments