Fixes: U4-6297 Add Settings to Grid Controls
Reusing the existing code for calling the dialog instead of having a separate method for this.
This commit is contained in:
@@ -30,11 +30,16 @@ angular.module("umbraco")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$scope.styles = _.filter( angular.copy($scope.dialogOptions.config.items.styles), function(item){return (item.applyTo === undefined || item.applyTo === $scope.dialogOptions.itemType); });
|
||||
$scope.config = _.filter( angular.copy($scope.dialogOptions.config.items.config), function(item){return (item.applyTo === undefined || item.applyTo === $scope.dialogOptions.itemType); });
|
||||
|
||||
|
||||
// if opening a settings dialog from a control - use only settings from this control
|
||||
// otherwise use editor configuration for row/cell settings
|
||||
if ($scope.dialogOptions.itemType === 'control') {
|
||||
$scope.config = $scope.dialogOptions.gridItem.editor.config.settings;
|
||||
$scope.styles = null;
|
||||
} else {
|
||||
$scope.styles = _.filter(angular.copy($scope.dialogOptions.config.items.styles), function (item) { return (item.applyTo === undefined || item.applyTo === $scope.dialogOptions.itemType); });
|
||||
$scope.config = _.filter(angular.copy($scope.dialogOptions.config.items.config), function (item) { return (item.applyTo === undefined || item.applyTo === $scope.dialogOptions.itemType); });
|
||||
}
|
||||
|
||||
var element = $scope.dialogOptions.gridItem;
|
||||
if(angular.isObject(element.config)){
|
||||
|
||||
@@ -307,28 +307,6 @@ angular.module("umbraco")
|
||||
|
||||
};
|
||||
|
||||
|
||||
// *********************************************
|
||||
// Control management functions
|
||||
// *********************************************
|
||||
|
||||
$scope.editControlSettings = function (control) {
|
||||
|
||||
var obj = $scope.model.config;
|
||||
obj.items.config = control.editor.config.settings;
|
||||
|
||||
dialogService.open(
|
||||
{
|
||||
template: "views/propertyeditors/grid/dialogs/config.html",
|
||||
gridItem: { "config": (control.value ? control.value.settings : null) },
|
||||
itemType: null,
|
||||
config: obj,
|
||||
callback: function (data) {
|
||||
control.settings = data.config;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// *********************************************
|
||||
// Area management functions
|
||||
// *********************************************
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
<!-- control setting area -->
|
||||
<div class="cell-tools-edit" ng-style="hasSettings && $first && {'top': '99px'}" ng-if="control.editor.config && control.editor.config.settings">
|
||||
<a class="iconBox"
|
||||
ng-click="editControlSettings(control)"
|
||||
ng-click="editGridItemSettings(control, 'control')"
|
||||
href>
|
||||
<i class="icon icon-hammer"></i>
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user