1
0
mirror of https://github.com/bitwarden/web synced 2026-01-09 03:53:28 +00:00

collection add/edit groups

This commit is contained in:
Kyle Spearrin
2017-05-11 12:22:03 -04:00
parent 96a91b97e9
commit bfae8e7def
10 changed files with 151 additions and 33 deletions

View File

@@ -19,7 +19,11 @@
var collections = {};
if ($event.target.checked) {
for (var i = 0; i < $scope.collections.length; i++) {
collections[$scope.collections[i].id] = true;
collections[$scope.collections[i].id] = {
id: $scope.collections[i].id,
readOnly: ($scope.collections[i].id in $scope.selectedCollections) ?
$scope.selectedCollections[$scope.collections[i].id].readOnly : false
};
}
}
@@ -31,7 +35,16 @@
delete $scope.selectedCollections[id];
}
else {
$scope.selectedCollections[id] = true;
$scope.selectedCollections[id] = {
id: id,
readOnly: false
};
}
};
$scope.toggleCollectionReadOnlySelection = function (id) {
if (id in $scope.selectedCollections) {
$scope.selectedCollections[id].readOnly = !!!$scope.selectedCollections[id].readOnly;
}
};
@@ -50,10 +63,10 @@
};
if (!group.accessAll) {
group.collectionIds = [];
for (var id in $scope.selectedCollections) {
if ($scope.selectedCollections.hasOwnProperty(id)) {
group.collectionIds.push(id);
group.collections = [];
for (var collectionId in $scope.selectedCollections) {
if ($scope.selectedCollections.hasOwnProperty(collectionId)) {
group.collections.push($scope.selectedCollections[collectionId]);
}
}
}