Compare commits

...

2 Commits

Author SHA1 Message Date
Niels Lyngsø 992cc48f56 added missing $location reference 2019-02-18 15:49:43 +01:00
Niels Lyngsø 897d6f2dde List & Grid should only open items as infinity editing if entityType is Content. 2019-02-18 15:38:39 +01:00
2 changed files with 55 additions and 40 deletions
@@ -10,7 +10,7 @@
"use strict";
function ListViewGridLayoutController($scope, $routeParams, mediaHelper, mediaResource,
listViewHelper, mediaTypeHelper, editorService) {
listViewHelper, mediaTypeHelper, editorService, $location) {
var vm = this;
var umbracoSettings = Umbraco.Sys.ServerVariables.umbracoSettings;
@@ -120,26 +120,34 @@
function goToItem(node, $event, $index) {
$event.stopPropagation();
var contentEditor = {
id: node.id,
submit: function (model) {
// update the node
node.name = model.contentNode.name;
// TODO: node.description = model.contentNode.description;
node.published = model.contentNode.hasPublishedVersion;
if (entityType !== "Member") {
entityResource.getUrl(model.contentNode.id, entityType).then(function (data) {
node.url = data;
});
if ($scope.entityType === "content") {
var contentEditor = {
id: node.id,
submit: function (model) {
// update the node
node.name = model.contentNode.name;
// TODO: node.description = model.contentNode.description;
node.published = model.contentNode.hasPublishedVersion;
if (entityType !== "Member") {
entityResource.getUrl(model.contentNode.id, entityType).then(function (data) {
node.url = data;
});
}
editorService.close();
},
close: function () {
editorService.close();
}
editorService.close();
},
close: function () {
editorService.close();
}
};
editorService.contentEditor(contentEditor);
};
editorService.contentEditor(contentEditor);
} else {
// if node.id is 2147483647 (int.MaxValue) use node.key
$location.path($scope.entityType + '/' + $scope.entityType + '/edit/' + (node.id === 2147483647 ? node.key : node.id));
}
}
activate();
@@ -1,7 +1,7 @@
(function () {
"use strict";
function ListViewListLayoutController($scope, listViewHelper, mediaHelper, mediaTypeHelper, editorService) {
function ListViewListLayoutController($scope, listViewHelper, mediaHelper, mediaTypeHelper, editorService, $location) {
var vm = this;
var umbracoSettings = Umbraco.Sys.ServerVariables.umbracoSettings;
@@ -54,26 +54,33 @@
function clickItem(node) {
var contentEditor = {
id: node.id,
submit: function (model) {
// update the node
node.name = model.contentNode.name;
// TODO: node.description = model.contentNode.description;
node.published = model.contentNode.hasPublishedVersion;
if (entityType !== "Member") {
entityResource.getUrl(model.contentNode.id, entityType).then(function (data) {
node.url = data;
});
if ($scope.entityType === "content") {
var contentEditor = {
id: node.id,
submit: function (model) {
// update the node
node.name = model.contentNode.name;
// TODO: node.description = model.contentNode.description;
node.published = model.contentNode.hasPublishedVersion;
if (entityType !== "Member") {
entityResource.getUrl(model.contentNode.id, entityType).then(function (data) {
node.url = data;
});
}
editorService.close();
},
close: function () {
editorService.close();
}
editorService.close();
},
close: function () {
editorService.close();
}
};
editorService.contentEditor(contentEditor);
};
editorService.contentEditor(contentEditor);
} else {
// if node.id is 2147483647 (int.MaxValue) use node.key
$location.path($scope.entityType + '/' + $scope.entityType + '/edit/' + (node.id === 2147483647 ? node.key : node.id));
}
}