From 543a34a6f3e1381905316369f303e6bcf6763539 Mon Sep 17 00:00:00 2001 From: Shannon Date: Mon, 19 Nov 2018 17:58:42 +1100 Subject: [PATCH 1/3] Fixes how the new move method on MediaService deals with event messages --- src/Umbraco.Core/Services/MediaService.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Umbraco.Core/Services/MediaService.cs b/src/Umbraco.Core/Services/MediaService.cs index 3f13f18e87..2a0588769a 100644 --- a/src/Umbraco.Core/Services/MediaService.cs +++ b/src/Umbraco.Core/Services/MediaService.cs @@ -779,16 +779,9 @@ namespace Umbraco.Core.Services var originalPath = media.Path; var moveEventInfo = new MoveEventInfo(media, originalPath, parentId); - var moveEventArgs = new MoveEventArgs(moveEventInfo); + var moveEventArgs = new MoveEventArgs(true, evtMsgs, moveEventInfo); if (uow.Events.DispatchCancelable(Moving, this, moveEventArgs, "Moving")) { - if (moveEventArgs.Messages.Count > 0) - { - foreach (var message in moveEventArgs.Messages.GetAll()) - { - evtMsgs.Add(message); - } - } uow.Commit(); return OperationStatus.Cancelled(evtMsgs); ; } From 80070e7332a7d288a6d1edb91c263f1eb27a35b6 Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 20 Nov 2018 12:20:16 +1100 Subject: [PATCH 2/3] Fixes how the new move method on MediaService deals with event messages --- src/Umbraco.Core/Services/MediaService.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Umbraco.Core/Services/MediaService.cs b/src/Umbraco.Core/Services/MediaService.cs index 2a0588769a..d1f11c619a 100644 --- a/src/Umbraco.Core/Services/MediaService.cs +++ b/src/Umbraco.Core/Services/MediaService.cs @@ -1104,16 +1104,9 @@ namespace Umbraco.Core.Services media.EnsureValidPath(Logger, entity => GetById(entity.ParentId), QuickUpdate); var originalPath = media.Path; var moveEventInfo = new MoveEventInfo(media, originalPath, Constants.System.RecycleBinMedia); - var moveEventArgs = new MoveEventArgs(moveEventInfo); + var moveEventArgs = new MoveEventArgs(true, evtMsgs, moveEventInfo); if (uow.Events.DispatchCancelable(Trashing, this, moveEventArgs, "Trashing")) { - if (moveEventArgs.Messages.Count > 0) - { - foreach (var message in moveEventArgs.Messages.GetAll()) - { - evtMsgs.Add(message); - } - } uow.Commit(); return OperationStatus.Cancelled(evtMsgs); } From 9ae4d1cdf50625cd7c55f6fdb917b6dc45f253f4 Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 20 Nov 2018 14:10:20 +1100 Subject: [PATCH 3/3] fixes how the grid rte resizes when a tab changes to use the proper event handler --- .../components/grid/grid.rte.directive.js | 15 +++++++++++---- .../directives/validation/valtab.directive.js | 12 +----------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/grid/grid.rte.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/grid/grid.rte.directive.js index 5a68d36bc1..f3492298b8 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/grid/grid.rte.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/grid/grid.rte.directive.js @@ -363,11 +363,18 @@ angular.module("umbraco.directives") //}; - var tabShownListener = eventsService.on("valTab.tabShown", function (e, args) { - //the tab has been shown, trigger the mceAutoResize (as it could have timed out before the tab was shown) - if (tinyMceEditor !== undefined && tinyMceEditor != null) { - tinyMceEditor.execCommand('mceAutoResize', false, null, null); + var tabShownListener = eventsService.on("app.tabChange", function (e, args) { + + var tabId = args.id; + var myTabId = element.closest(".umb-tab-pane").attr("rel"); + + if (String(tabId) === myTabId) { + //the tab has been shown, trigger the mceAutoResize (as it could have timed out before the tab was shown) + if (tinyMceEditor !== undefined && tinyMceEditor != null) { + tinyMceEditor.execCommand('mceAutoResize', false, null, null); + } } + }); //listen for formSubmitting event (the result is callback used to remove the event subscription) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/validation/valtab.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/validation/valtab.directive.js index c5d7cb6e58..f23280614c 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/validation/valtab.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/validation/valtab.directive.js @@ -6,7 +6,7 @@ * @description Used to show validation warnings for a tab to indicate that the tab content has validations errors in its data. * In order for this directive to work, the valFormManager directive must be placed on the containing form. **/ -function valTab(eventsService) { +function valTab() { return { require: ['^form', '^valFormManager'], restrict: "A", @@ -31,16 +31,6 @@ function valTab(eventsService) { scope.tabHasError = false; } }); - var tabShownFunc = function (e) { - var tabContent = element.closest(".umb-panel").find("#" + tabId); - eventsService.emit('valTab.tabShown', { originalEvent: e, tab: scope.tab, content: tabContent }); - - }; - var anchorElement = element.find("a[data-toggle='tab']"); - anchorElement.on('shown.bs.tab', tabShownFunc); - scope.$on('$destroy', function () { - anchorElement.off('shown.bs.tab', tabShownFunc); - }); } }; }