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 6f41943c5c..e57798ed80 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 1012e4d91d..b73aa0f29c 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,7 +31,6 @@ function valTab(eventsService) { scope.tabHasError = false; } }); - } }; }