Make it possible for node types to have a 'custom view'

This 'custom view' means that the URL to view the node (as returned by
url_for_node(…)) cannot be loaded via XHR and embedded in the project
viewer, but should rather be used as the actual browser URL instead.

Currently only blogs use this.
This commit is contained in:
2017-09-28 17:50:31 +02:00
parent 8ad2ee8729
commit ddc52b969e
3 changed files with 45 additions and 2 deletions

View File

@@ -605,8 +605,8 @@ script.
}
// Check the type of node and act accordingly
if (data.node.original.type == 'blog') {
window.location.replace('blog');
if (data.node.original.custom_view) {
window.location = data.node.a_attr.href;
} else {
var currentNodeId = ProjectUtils.nodeId();
if (currentNodeId != selectedNodeId) {