open regular content editor instead of mini content editor

This commit is contained in:
Mads Rasmussen
2018-07-02 15:57:16 +02:00
parent a5467bc277
commit e6e619b967
6 changed files with 23 additions and 8 deletions

View File

@@ -533,8 +533,8 @@
// methods for infinite editing
$scope.close = function() {
if($scope.model.close) {
$scope.model.close($scope.model);
if($scope.infiniteModel.close) {
$scope.infiniteModel.close($scope.infiniteModel);
}
};
@@ -563,7 +563,7 @@
getMethod: "&",
getScaffoldMethod: "&?",
culture: "=?",
model: "=?"
infiniteModel: "=?"
}
};

View File

@@ -57,7 +57,7 @@
<umb-editor-footer-content-right>
<umb-button
ng-if="model.infiniteMode"
ng-if="infiniteModel.infiniteMode"
action="close()"
button-style="link"
label="Close"

View File

@@ -8,6 +8,8 @@
*/
function ContentEditController($scope, $routeParams, contentResource) {
var infiniteMode = $scope.model && $scope.model.infiniteMode;
function scaffoldEmpty() {
return contentResource.getScaffold($routeParams.id, $routeParams.doctype);
}
@@ -15,12 +17,12 @@ function ContentEditController($scope, $routeParams, contentResource) {
return contentResource.getBlueprintScaffold($routeParams.id, $routeParams.blueprintId);
}
$scope.contentId = $routeParams.id;
$scope.contentId = infiniteMode ? $scope.model.id : $routeParams.id;
$scope.saveMethod = contentResource.save;
$scope.getMethod = contentResource.getById;
$scope.getScaffoldMethod = $routeParams.blueprintId ? scaffoldBlueprint : scaffoldEmpty;
$scope.page = $routeParams.page;
$scope.isNew = $routeParams.create;
$scope.isNew = infiniteMode ? $scope.model.create : $routeParams.create;
$scope.culture = $routeParams.cculture ? $routeParams.cculture : $routeParams.mculture; //load the default culture selected in the main tree if any
}

View File

@@ -8,6 +8,6 @@
tree-alias="content"
is-new="isNew"
culture="culture"
model="model">
infinite-model="model">
</content-editor>
</div>

View File

@@ -242,6 +242,19 @@ function contentPickerController($scope, entityResource, editorState, iconHelper
$scope.renderModel = [];
};
$scope.openContentEditor = function(node) {
var contentEditor = {
id: node.id,
submit: function(model) {
editorService.close();
},
close: function() {
editorService.close();
}
};
editorService.contentEditor(contentEditor);
};
$scope.openMiniEditor = function(node) {
miniEditorHelper.launchMiniEditor(node).then(function(updatedNode){
// update the node

View File

@@ -15,7 +15,7 @@
allow-remove="allowRemoveButton"
allow-open="model.config.showOpenButton && allowOpenButton && !dialogEditor"
on-remove="remove($index)"
on-open="openMiniEditor(node)">
on-open="openContentEditor(node)">
</umb-node-preview>
</div>