2017-06-09 15:46:25 +02:00
|
|
|
|
angular
|
|
|
|
|
.module('bit.vault')
|
|
|
|
|
|
2017-10-11 15:45:52 +02:00
|
|
|
|
.controller('vaultMoveCiphersController', function ($scope, apiService, $uibModalInstance, ids, $analytics,
|
2017-11-22 18:08:31 +01:00
|
|
|
|
$rootScope, $filter) {
|
2017-10-11 15:45:52 +02:00
|
|
|
|
$analytics.eventTrack('vaultMoveCiphersController', { category: 'Modal' });
|
2018-03-17 16:42:35 +01:00
|
|
|
|
$scope.folders = $rootScope.vaultFolders;
|
2017-06-09 15:46:25 +02:00
|
|
|
|
$scope.count = ids.length;
|
|
|
|
|
|
|
|
|
|
$scope.save = function () {
|
|
|
|
|
$scope.savePromise = apiService.ciphers.moveMany({ ids: ids, folderId: $scope.folderId }, function () {
|
2017-10-11 15:45:52 +02:00
|
|
|
|
$analytics.eventTrack('Bulk Moved Ciphers');
|
2017-06-09 15:46:25 +02:00
|
|
|
|
$uibModalInstance.close($scope.folderId || null);
|
|
|
|
|
}).$promise;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.folderSort = function (item) {
|
|
|
|
|
if (!item.id) {
|
|
|
|
|
return '!';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return item.name.toLowerCase();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$scope.close = function () {
|
|
|
|
|
$uibModalInstance.dismiss('cancel');
|
|
|
|
|
};
|
|
|
|
|
});
|