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 5424f6f62d..6f0511f10d 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 @@ -32,9 +32,9 @@ // get document type details scope.documentType = scope.node.documentType; - // load audit trail on tab change - eventsService.on("tab change", function (event, args) { - if (args.tabId === "0" || args.tabHash === "#tab0") { + // load audit trail when on the info tab + eventsService.on("app.tabChange", function (event, args) { + if (args.id === -1) { loadAuditTrail(); } }); diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/tabs/umbtabs.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/tabs/umbtabs.directive.js index 63feb428ea..494c4a3f7d 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/tabs/umbtabs.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/tabs/umbtabs.directive.js @@ -19,22 +19,20 @@ angular.module("umbraco.directives") var curr = $(event.target); // active tab var prev = $(event.relatedTarget); // previous tab - - - var args = { tabId: curr.context.id, tabHash: curr.context.hash } - // emit tab change event - eventsService.emit("tab change", args); + + // emit tab change event + var tabId = Number(curr.context.hash.replace("#tab", "")); + var args = { id: tabId, hash: curr.context.hash }; + + eventsService.emit("app.tabChange", args); $scope.$apply(); for (var c in callbacks) { callbacks[c].apply(this, [{current: curr, previous: prev}]); } - } - - //NOTE: it MUST be done this way - binding to an ancestor element that exists // in the DOM to bind to the dynamic elements that will be created.