Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 992cc48f56 | |||
| 897d6f2dde |
+28
-20
@@ -10,7 +10,7 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function ListViewGridLayoutController($scope, $routeParams, mediaHelper, mediaResource,
|
function ListViewGridLayoutController($scope, $routeParams, mediaHelper, mediaResource,
|
||||||
listViewHelper, mediaTypeHelper, editorService) {
|
listViewHelper, mediaTypeHelper, editorService, $location) {
|
||||||
|
|
||||||
var vm = this;
|
var vm = this;
|
||||||
var umbracoSettings = Umbraco.Sys.ServerVariables.umbracoSettings;
|
var umbracoSettings = Umbraco.Sys.ServerVariables.umbracoSettings;
|
||||||
@@ -120,26 +120,34 @@
|
|||||||
function goToItem(node, $event, $index) {
|
function goToItem(node, $event, $index) {
|
||||||
$event.stopPropagation();
|
$event.stopPropagation();
|
||||||
|
|
||||||
var contentEditor = {
|
if ($scope.entityType === "content") {
|
||||||
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.contentEditor(contentEditor);
|
|
||||||
|
|
||||||
|
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.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();
|
activate();
|
||||||
|
|||||||
+27
-20
@@ -1,7 +1,7 @@
|
|||||||
(function () {
|
(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function ListViewListLayoutController($scope, listViewHelper, mediaHelper, mediaTypeHelper, editorService) {
|
function ListViewListLayoutController($scope, listViewHelper, mediaHelper, mediaTypeHelper, editorService, $location) {
|
||||||
|
|
||||||
var vm = this;
|
var vm = this;
|
||||||
var umbracoSettings = Umbraco.Sys.ServerVariables.umbracoSettings;
|
var umbracoSettings = Umbraco.Sys.ServerVariables.umbracoSettings;
|
||||||
@@ -54,26 +54,33 @@
|
|||||||
|
|
||||||
function clickItem(node) {
|
function clickItem(node) {
|
||||||
|
|
||||||
var contentEditor = {
|
if ($scope.entityType === "content") {
|
||||||
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.contentEditor(contentEditor);
|
|
||||||
|
|
||||||
|
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.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));
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user