1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-28 17:27:50 +01:00

simplify collapse/expand logic

This commit is contained in:
Kyle Spearrin 2017-11-30 22:47:16 -05:00
parent e307d1e87d
commit 37dddea515
2 changed files with 7 additions and 20 deletions

2
dist/.publish vendored

@ -1 +1 @@
Subproject commit d425a19baf91e8a81b27df881600b5a73416dce3
Subproject commit 466ddf04c4878942e2901a7330d6de3b2971c204

View File

@ -169,12 +169,10 @@
$localStorage.collapsedFolders.none = true;
$localStorage.collapsedFolders.favorite = true;
if (!$rootScope.vaultGroupings) {
return;
}
for (var i = 0; i < $rootScope.vaultGroupings.length; i++) {
$localStorage.collapsedFolders[$rootScope.vaultGroupings[i].id] = true;
if ($rootScope.vaultGroupings) {
for (var i = 0; i < $rootScope.vaultGroupings.length; i++) {
$localStorage.collapsedFolders[$rootScope.vaultGroupings[i].id] = true;
}
}
$('.box').addClass('collapsed-box');
@ -182,19 +180,8 @@
};
$scope.expandAll = function () {
if (!$localStorage.collapsedFolders) {
$localStorage.collapsedFolders = {};
}
delete $localStorage.collapsedFolders.none;
delete $localStorage.collapsedFolders.favorite;
if (!$rootScope.vaultGroupings) {
return;
}
for (var i = 0; i < $rootScope.vaultGroupings.length; i++) {
delete $localStorage.collapsedFolders[$rootScope.vaultGroupings[i].id];
if ($localStorage.collapsedFolders) {
delete $localStorage.collapsedFolders;
}
$('.box').removeClass('collapsed-box');