added event to load audit trail on Properties tab only
This commit is contained in:
+8
-3
@@ -32,11 +32,16 @@
|
||||
// get document type details
|
||||
scope.documentType = getDocumentType(scope.node);
|
||||
|
||||
loadAuditTrail();
|
||||
|
||||
// load audit trail on tab change
|
||||
eventsService.on("tab change", function (event, args) {
|
||||
if (args.context.innerHTML === "Properties" && args.context.hash === "#tab0") {
|
||||
console.log(args.context.alias);
|
||||
loadAuditTrail();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
scope.auditTrailPageChange = function(pageNumber) {
|
||||
scope.auditTrailPageChange = function (pageNumber) {
|
||||
scope.auditTrailOptions.pageNumber = pageNumber;
|
||||
loadAuditTrail();
|
||||
};
|
||||
|
||||
+8
-1
@@ -8,7 +8,7 @@ angular.module("umbraco.directives")
|
||||
.directive('umbTabs', function () {
|
||||
return {
|
||||
restrict: 'A',
|
||||
controller: function ($scope, $element, $attrs) {
|
||||
controller: function ($scope, $element, $attrs, eventsService) {
|
||||
|
||||
var callbacks = [];
|
||||
this.onTabShown = function(cb) {
|
||||
@@ -20,13 +20,20 @@ angular.module("umbraco.directives")
|
||||
var curr = $(event.target); // active tab
|
||||
var prev = $(event.relatedTarget); // previous tab
|
||||
|
||||
//emit tab change event
|
||||
eventsService.emit("tab change", curr);
|
||||
|
||||
$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.
|
||||
// It would be nicer to create this event handler as a directive for which child
|
||||
|
||||
Reference in New Issue
Block a user