From b2138d6376d3582baa175f819eefafc7bf7b43d8 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 18 Oct 2018 14:06:21 +0200 Subject: [PATCH] reload content after rollback --- .../directives/components/content/edit.controller.js | 11 +++++++++++ .../content/umbcontentnodeinfo.directive.js | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js index 98e02f3d55..6670a41ac4 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/edit.controller.js @@ -103,6 +103,17 @@ loadContent(); } })); + + evts.push(eventsService.on("editors.content.reload", function (name, args) { + // if this content item uses the updated doc type we need to reload the content item + if(args && args.node && args.node.key === $scope.content.key) { + $scope.page.loading = true; + loadContent().then(function() { + $scope.page.loading = false; + }); + } + })); + } /** diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbcontentnodeinfo.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbcontentnodeinfo.directive.js index 327d99a8c6..e2292c50d5 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbcontentnodeinfo.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/content/umbcontentnodeinfo.directive.js @@ -106,6 +106,8 @@ var rollback = { node: scope.node, submit: function(model) { + const args = { node: scope.node }; + eventsService.emit("editors.content.reload", args); editorService.close(); }, close: function() {