Fixes displaying the audit trail on the info tab

This commit is contained in:
Shannon
2018-04-10 11:23:39 +10:00
parent 10b777a4e0
commit bf296158b0
2 changed files with 51 additions and 51 deletions

View File

@@ -243,7 +243,7 @@
// load audit trail when on the info tab
evts.push(eventsService.on("app.tabChange", function (event, args) {
$timeout(function(){
if (args.id === -1) {
if (args.alias === "info") {
isInfoTab = true;
loadAuditTrail();
} else {

View File

@@ -1,64 +1,64 @@
(function() {
'use strict';
(function () {
'use strict';
function EditorNavigationDirective() {
function EditorNavigationDirective(eventsService) {
function link(scope, el, attr, ctrl) {
function link(scope, el, attr, ctrl) {
scope.showNavigation = true;
scope.showNavigation = true;
scope.clickNavigationItem = function(selectedItem) {
setItemToActive(selectedItem);
runItemAction(selectedItem);
};
scope.clickNavigationItem = function (selectedItem) {
setItemToActive(selectedItem);
runItemAction(selectedItem);
eventsService.emit("app.tabChange", selectedItem);
};
function runItemAction(selectedItem) {
if (selectedItem.action) {
selectedItem.action(selectedItem);
}
}
function setItemToActive(selectedItem) {
// set all other views to inactive
if (selectedItem.view) {
for (var index = 0; index < scope.navigation.length; index++) {
var item = scope.navigation[index];
item.active = false;
}
// set view to active
selectedItem.active = true;
}
}
function activate() {
// hide navigation if there is only 1 item
if (scope.navigation.length <= 1) {
scope.showNavigation = false;
function runItemAction(selectedItem) {
if (selectedItem.action) {
selectedItem.action(selectedItem);
}
}
}
function setItemToActive(selectedItem) {
// set all other views to inactive
if (selectedItem.view) {
activate();
for (var index = 0; index < scope.navigation.length; index++) {
var item = scope.navigation[index];
item.active = false;
}
}
// set view to active
selectedItem.active = true;
}
}
var directive = {
restrict: 'E',
replace: true,
templateUrl: 'views/components/editor/umb-editor-navigation.html',
scope: {
navigation: "="
},
link: link
};
function activate() {
return directive;
}
// hide navigation if there is only 1 item
if (scope.navigation.length <= 1) {
scope.showNavigation = false;
}
angular.module('umbraco.directives.html').directive('umbEditorNavigation', EditorNavigationDirective);
}
activate();
}
var directive = {
restrict: 'E',
replace: true,
templateUrl: 'views/components/editor/umb-editor-navigation.html',
scope: {
navigation: "="
},
link: link
};
return directive;
}
angular.module('umbraco.directives.html').directive('umbEditorNavigation', EditorNavigationDirective);
})();