Compare commits

...

1 Commits

Author SHA1 Message Date
Kenn Jacobsen 44a558ee6e Reload the node when publishing all unpublished children 2018-10-11 14:28:22 +02:00
2 changed files with 12 additions and 4 deletions
@@ -150,7 +150,8 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
sourceUrl: currentMenuNode.childNodesUrl, sourceUrl: currentMenuNode.childNodesUrl,
updateDefinition: function() { updateDefinition: function() {
throw "'updateDefinition' method is not supported in Umbraco 7, consider upgrading to the new v7 APIs"; throw "'updateDefinition' method is not supported in Umbraco 7, consider upgrading to the new v7 APIs";
} },
expanded: currentMenuNode.expanded === true
}; };
//defined getters that will throw a not implemented/supported exception //defined getters that will throw a not implemented/supported exception
Object.defineProperty(legacyNode, "menu", { Object.defineProperty(legacyNode, "menu", {
@@ -37,12 +37,13 @@
}, },
startPublish: function() { startPublish: function() {
this.processStatus("publishing"); this.processStatus("publishing");
var includeUnpublished = self._koViewModel.includeUnpublished();
$.post(self._opts.restServiceLocation + "PublishDocument", $.post(self._opts.restServiceLocation + "PublishDocument",
JSON.stringify({ JSON.stringify({
documentId: self._opts.documentId, documentId: self._opts.documentId,
publishDescendants: self._koViewModel.publishAll(), publishDescendants: self._koViewModel.publishAll(),
includeUnpublished: self._koViewModel.includeUnpublished() includeUnpublished: includeUnpublished
}), }),
function (e) { function (e) {
self._koViewModel.processStatus("complete"); self._koViewModel.processStatus("complete");
@@ -59,7 +60,13 @@
//sync the tree //sync the tree
UmbClientMgr.mainTree().setActiveTreeType('content'); UmbClientMgr.mainTree().setActiveTreeType('content');
UmbClientMgr.mainTree().syncTree(self._opts.documentPath, true); UmbClientMgr.mainTree().syncTree(self._opts.documentPath, true)
if (includeUnpublished) {
var node = UmbClientMgr.mainTree().getActionNode();
if (node.expanded === true) {
UmbClientMgr.mainTree().reloadActionNode();
}
}
}); });
} }
}; };