mirror of
https://github.com/nextcloud/passman.git
synced 2026-01-04 06:37:12 +08:00
limit initializeNavbar calls to one time per controllerinstance
Signed-off-by: fnuesse <felix.nuesse@t-online.de>
This commit is contained in:
parent
5ef8c51548
commit
9485ccbd97
1 changed files with 7 additions and 2 deletions
|
|
@ -193,18 +193,23 @@
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
$scope.legacyNavbarDefault=true;
|
||||
$scope.legacyNavbarAlreadyInitialized=false;
|
||||
|
||||
if (typeof $scope.legacyNavbar === 'undefined') {
|
||||
$scope.legacyNavbar = $scope.legacyNavbarDefault;
|
||||
}
|
||||
|
||||
$scope.$watch('legacyNavbar', function(newValue, oldValue) {
|
||||
VaultService.setVaultSetting("vaultNavBarLegacy",newValue);
|
||||
});
|
||||
|
||||
$scope.initializeNavbar = function () {
|
||||
if($scope.legacyNavbarAlreadyInitialized){
|
||||
return;
|
||||
}
|
||||
$scope.legacyNavbar = VaultService.getVaultSetting('vaultNavBarLegacy',$scope.legacyNavbarDefault);
|
||||
$scope.legacyNavbarAlreadyInitialized=true;
|
||||
};
|
||||
|
||||
$rootScope.$on('credentials_loaded', function () {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue