Info panes not loading prerequisites (#13486)

* load relations immediately on init and remove call to non-existing function `appTabChange` on destroy

* load relations immediately on init and remove now not-used eventsService
This commit is contained in:
Jacob Overgaard
2022-11-29 10:07:52 +01:00
committed by GitHub
parent b9990f23db
commit b5a3dcb81e
2 changed files with 4 additions and 30 deletions

View File

@@ -6,10 +6,9 @@
* @description
* The controller for the info view of the datatype editor
*/
function DataTypeInfoController($scope, $routeParams, dataTypeResource, eventsService, $timeout, editorService) {
function DataTypeInfoController($scope, $routeParams, dataTypeResource, $timeout, editorService) {
var vm = this;
var evts = [];
var referencesLoaded = false;
vm.references = {};
@@ -48,7 +47,7 @@ function DataTypeInfoController($scope, $routeParams, dataTypeResource, eventsSe
function open(id, event, type) {
// targeting a new tab/window?
if (event.ctrlKey ||
if (event.ctrlKey ||
event.shiftKey ||
event.metaKey || // apple
(event.button && event.button === 1) // middle click, >IE9 + everyone else
@@ -85,25 +84,7 @@ function DataTypeInfoController($scope, $routeParams, dataTypeResource, eventsSe
}
}
// load data type references when the references tab is activated
evts.push(eventsService.on("app.tabChange", function (event, args) {
$timeout(function () {
if (args.alias === "info") {
loadRelations();
}
});
}));
//ensure to unregister from all events!
$scope.$on('$destroy', function () {
for (var e in evts) {
eventsService.unsubscribe(evts[e]);
}
});
loadRelations();
}
angular.module("umbraco").controller("Umbraco.Editors.DataType.InfoController", DataTypeInfoController);

View File

@@ -54,14 +54,7 @@ function RelationTypeEditController($scope, $routeParams, relationTypeResource,
});
// load references when the 'relations' tab is first activated/switched to
var appTabChange = eventsService.on("app.tabChange", function (event, args) {
if (args.alias === "relations") {
loadRelations();
}
});
$scope.$on('$destroy', function () {
appTabChange();
});
loadRelations();
// Inital page/overview API call of relation type
relationTypeResource.getById($routeParams.id)