From d806855698d374378bae65878cb4c006d76eb22c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Fri, 22 Mar 2019 16:22:36 +0100 Subject: [PATCH] listen for "editors.documentType.saved" instead of "editors.content.reload" --- .../components/content/edit.controller.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) 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 80b5f4ed39..a7ce013bc3 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 @@ -116,6 +116,13 @@ function isContentCultureVariant() { return $scope.content.variants.length > 1; } + + function reload() { + $scope.page.loading = true; + loadContent().then(function() { + $scope.page.loading = false; + }); + } function bindEvents() { //bindEvents can be called more than once and we don't want to have multiple bound events @@ -123,13 +130,10 @@ eventsService.unsubscribe(evts[e]); } - evts.push(eventsService.on("editors.content.reload", function (name, args) { + evts.push(eventsService.on("editors.documentType.saved", 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; - }); + if(args && args.documentType && $scope.content.documentType.id === args.documentType.id) { + reload(); } }));