From 00cf8dcf05393e15f8a743763d8f9059f2a6979f Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Thu, 11 Oct 2018 14:28:22 +0200 Subject: [PATCH] Reload the node when publishing all unpublished children --- .../lib/umbraco/LegacyUmbClientMgr.js | 3 ++- .../umbraco_client/Dialogs/PublishDialog.js | 13 ++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/lib/umbraco/LegacyUmbClientMgr.js b/src/Umbraco.Web.UI.Client/lib/umbraco/LegacyUmbClientMgr.js index 9fe887d0b6..223695322f 100644 --- a/src/Umbraco.Web.UI.Client/lib/umbraco/LegacyUmbClientMgr.js +++ b/src/Umbraco.Web.UI.Client/lib/umbraco/LegacyUmbClientMgr.js @@ -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", { diff --git a/src/Umbraco.Web.UI/umbraco_client/Dialogs/PublishDialog.js b/src/Umbraco.Web.UI/umbraco_client/Dialogs/PublishDialog.js index d034a07a4a..1781f71b27 100644 --- a/src/Umbraco.Web.UI/umbraco_client/Dialogs/PublishDialog.js +++ b/src/Umbraco.Web.UI/umbraco_client/Dialogs/PublishDialog.js @@ -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(); + } + } }); } };