1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

selection highlights

This commit is contained in:
Kyle Spearrin
2018-01-27 08:52:39 -05:00
parent b0e78be1f6
commit 85d4da7def
4 changed files with 59 additions and 15 deletions

View File

@@ -30,6 +30,12 @@ export class GroupingsComponent implements OnInit {
folders: any[];
collections: any[];
cipherType = CipherType;
selectedAll: boolean = false;
selectedFavorites: boolean = false;
selectedType: CipherType = null;
selectedFolder: boolean = false;
selectedFolderId: string = null;
selectedCollectionId: string = null;
constructor(private collectionService: CollectionService, private folderService: FolderService) {
// ctor
@@ -41,22 +47,42 @@ export class GroupingsComponent implements OnInit {
}
all() {
this.clearSelections();
this.selectedAll = true;
this.onAllClicked.emit();
}
favorites() {
this.clearSelections();
this.selectedFavorites = true;
this.onFavoritesClicked.emit();
}
type(type: CipherType) {
this.clearSelections();
this.selectedType = type;
this.onCipherTypeClicked.emit(type);
}
folder(folder: FolderView) {
this.clearSelections();
this.selectedFolder = true;
this.selectedFolderId = folder.id;
this.onFolderClicked.emit(folder);
}
collection(collection: CollectionView) {
this.clearSelections();
this.selectedCollectionId = collection.id;
this.onCollectionClicked.emit(collection);
}
clearSelections() {
this.selectedAll = false;
this.selectedFavorites = false;
this.selectedType = null;
this.selectedFolder = false;
this.selectedFolderId = null;
this.selectedCollectionId = null;
}
}