UI: Cleanup dashboard preserved states.
This commit is contained in:
parent
0e60537955
commit
e461fe919b
@ -264,6 +264,10 @@ export default function DashboardController(types, utils, dashboardUtils, widget
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$on("$destroy", function () {
|
||||
vm.dashboardCtx.stateController.cleanupPreservedStates();
|
||||
});
|
||||
|
||||
loadDashboard();
|
||||
|
||||
function loadWidgetLibrary() {
|
||||
|
||||
@ -54,6 +54,10 @@ export default function StatesComponent($compile, $templateCache, $controller, s
|
||||
}
|
||||
}
|
||||
|
||||
stateController.cleanupPreservedStates = function() {
|
||||
statesControllerService.cleanupPreservedStates();
|
||||
}
|
||||
|
||||
stateController.navigatePrevState = function(index) {
|
||||
if (scope.statesController) {
|
||||
scope.statesController.navigatePrevState(index);
|
||||
|
||||
@ -42,7 +42,8 @@ export default function StatesControllerService() {
|
||||
getStateControllers: getStateControllers,
|
||||
getStateController: getStateController,
|
||||
preserveStateControllerState: preserveStateControllerState,
|
||||
withdrawStateControllerState: withdrawStateControllerState
|
||||
withdrawStateControllerState: withdrawStateControllerState,
|
||||
cleanupPreservedStates: cleanupPreservedStates
|
||||
};
|
||||
|
||||
return service;
|
||||
@ -69,4 +70,10 @@ export default function StatesControllerService() {
|
||||
return state;
|
||||
}
|
||||
|
||||
function cleanupPreservedStates() {
|
||||
for (var id in statesControllers) {
|
||||
statesControllers[id].state = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user