Add button group to edit data type dialog with the possibility to save and save as new
This commit is contained in:
@@ -52,9 +52,12 @@
|
||||
}
|
||||
|
||||
.umb-overlay-drawer{
|
||||
height: 50px; left: 0px; right: 0px; bottom: 0px; position: absolute; overflow: auto;
|
||||
height: 50px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
position: absolute;
|
||||
padding: 10px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.umb-overlay-body{
|
||||
|
||||
@@ -12,5 +12,8 @@
|
||||
<div class="umb-overlay-drawer" ng-if="model.close || model.submit">
|
||||
<button ng-if="model.close" ng-click="model.close(model)" class="btn btn-link">Cancel</button>
|
||||
<button ng-click="model.submit(model)" ng-if="model.submit" class="btn btn-success">Submit</button>
|
||||
|
||||
<umb-button-group model="model.dataType" actions="model.multiActions" ng-if="model.multiActions"></umb-button-group>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@@ -415,13 +415,25 @@ function DocumentTypeEditController($scope, $rootScope, $routeParams, $log, cont
|
||||
$scope.dialogModel.dataType = {};
|
||||
$scope.dialogModel.property = property;
|
||||
$scope.dialogModel.view = "views/documentType/dialogs/editDataType/editDataType.html";
|
||||
$scope.dialogModel.multiActions = [
|
||||
{
|
||||
label: "Save",
|
||||
action: function(dataType) {
|
||||
saveDataType(dataType, false);
|
||||
}
|
||||
},
|
||||
{
|
||||
label: "Save as new",
|
||||
action: function(dataType) {
|
||||
saveDataType(dataType, true);
|
||||
}
|
||||
}
|
||||
];
|
||||
$scope.showDialog = true;
|
||||
|
||||
$scope.dialogModel.submit = function(model) {
|
||||
function saveDataType(dataType, isNew) {
|
||||
|
||||
var dataType = model.dataType;
|
||||
var preValues = createPreValueProps(model.dataType.preValues);
|
||||
var isNew = false;
|
||||
var preValues = createPreValueProps(dataType.preValues);
|
||||
|
||||
dataTypeResource.save(dataType, preValues, isNew).then(function(dataType) {
|
||||
|
||||
@@ -441,7 +453,7 @@ function DocumentTypeEditController($scope, $rootScope, $routeParams, $log, cont
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
$scope.dialogModel.close = function(model){
|
||||
$scope.editPropertyTypeSettings(property);
|
||||
|
||||
Reference in New Issue
Block a user