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
3 changed files with 25 additions and 7 deletions
@@ -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", {
@@ -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();
}
}
});
}
};
@@ -117,11 +117,21 @@ namespace Umbraco.Web.Trees
if (enableInheritedDocumentTypes)
{
menu.Items.Add<ActionNew>(Services.TextService.Localize(string.Format("actions/{0}", ActionNew.Instance.Alias)));
//no move action if this is a child doc type
if (parent == null)
{
menu.Items.Add<ActionMove>(Services.TextService.Localize(string.Format("actions/{0}", ActionMove.Instance.Alias)), true);
}
}
//no move action if this is a child doc type
if (parent == null)
else
{
menu.Items.Add<ActionMove>(Services.TextService.Localize(string.Format("actions/{0}", ActionMove.Instance.Alias)), true);
menu.Items.Add<ActionMove>(Services.TextService.Localize(string.Format("actions/{0}", ActionMove.Instance.Alias)));
//no move action if this is a child doc type
if (parent == null)
{
menu.Items.Add<ActionMove>(Services.TextService.Localize(string.Format("actions/{0}", ActionMove.Instance.Alias)), true);
}
}
menu.Items.Add<ActionCopy>(Services.TextService.Localize(string.Format("actions/{0}", ActionCopy.Instance.Alias)));
menu.Items.Add<ActionExport>(Services.TextService.Localize(string.Format("actions/{0}", ActionExport.Instance.Alias)), true).ConvertLegacyMenuItem(new UmbracoEntity