Reload the node when publishing all unpublished children

This commit is contained in:
Kenn Jacobsen
2018-10-11 14:28:22 +02:00
committed by Sebastiaan Janssen
parent ef343f04a8
commit 00cf8dcf05
2 changed files with 12 additions and 4 deletions

View File

@@ -150,7 +150,8 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
sourceUrl: currentMenuNode.childNodesUrl,
updateDefinition: function() {
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
Object.defineProperty(legacyNode, "menu", {

View File

@@ -37,12 +37,13 @@
},
startPublish: function() {
this.processStatus("publishing");
var includeUnpublished = self._koViewModel.includeUnpublished();
$.post(self._opts.restServiceLocation + "PublishDocument",
JSON.stringify({
documentId: self._opts.documentId,
publishDescendants: self._koViewModel.publishAll(),
includeUnpublished: self._koViewModel.includeUnpublished()
includeUnpublished: includeUnpublished
}),
function (e) {
self._koViewModel.processStatus("complete");
@@ -59,7 +60,13 @@
//sync the tree
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();
}
}
});
}
};