File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed
src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,9 @@ angular.module("umbraco")
29
29
}
30
30
31
31
32
- $scope . styles = angular . copy ( $scope . dialogOptions . config . items . styles ) ;
33
- $scope . config = angular . copy ( $scope . dialogOptions . config . items . config ) ;
32
+ $scope . styles = _ . filter ( angular . copy ( $scope . dialogOptions . config . items . styles ) , function ( item ) { return ( item . applyTo === undefined || item . applyTo === $scope . dialogOptions . itemType ) ; } ) ;
33
+ $scope . config = _ . filter ( angular . copy ( $scope . dialogOptions . config . items . config ) , function ( item ) { return ( item . applyTo === undefined || item . applyTo === $scope . dialogOptions . itemType ) ; } ) ;
34
+
34
35
35
36
var element = $scope . dialogOptions . gridItem ;
36
37
if ( angular . isObject ( element . config ) ) {
Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ angular.module("umbraco")
40
40
tinyMCE . execCommand ( 'mceAddEditor' , false , $ ( this ) . attr ( 'id' ) ) ;
41
41
} ) ;
42
42
}
43
-
44
43
} ;
45
44
46
45
var notIncludedRte = [ ] ;
@@ -235,13 +234,14 @@ angular.module("umbraco")
235
234
}
236
235
} ;
237
236
238
- $scope . editGridItemSettings = function ( gridItem ) {
237
+ $scope . editGridItemSettings = function ( gridItem , itemType ) {
239
238
240
239
dialogService . open (
241
240
{
242
241
template : "views/propertyeditors/grid/dialogs/config.html" ,
243
242
gridItem : gridItem ,
244
243
config : $scope . model . config ,
244
+ itemType : itemType ,
245
245
callback : function ( data ) {
246
246
247
247
gridItem . styles = data . styles ;
@@ -338,7 +338,8 @@ angular.module("umbraco")
338
338
339
339
var newControl = {
340
340
value : null ,
341
- editor : editor
341
+ editor : editor ,
342
+ $initializing : true
342
343
} ;
343
344
344
345
if ( index === undefined ) {
@@ -410,6 +411,8 @@ angular.module("umbraco")
410
411
$scope . model . value . sections . splice ( index , 1 ) ;
411
412
}
412
413
} ) ;
414
+ } else if ( $scope . model . config . items . templates && $scope . model . config . items . templates . length === 1 ) {
415
+ $scope . addTemplate ( $scope . model . config . items . templates [ 0 ] ) ;
413
416
}
414
417
415
418
if ( clear ) {
Original file line number Diff line number Diff line change 88
88
< a class ="iconBox "
89
89
ng-mouseover ="setInfohighlightRow(row) "
90
90
ng-mouseleave ="disableInfohighlightRow(row) "
91
- ng-click ="editGridItemSettings(row) "
91
+ ng-click ="editGridItemSettings(row, 'row' ) "
92
92
href >
93
93
< i class ="icon icon-settings "> </ i >
94
94
</ a >
154
154
< a class ="iconBox "
155
155
ng-mouseover ="setInfohighlightArea(area) "
156
156
ng-mouseleave ="disableInfohighlightArea(area) "
157
- ng-click ="editGridItemSettings(area) "
157
+ ng-click ="editGridItemSettings(area, 'cell' ) "
158
158
href >
159
159
< i class ="icon icon-settings "> </ i >
160
160
</ a >
You can’t perform that action at this time.
0 commit comments