2016-09-03 22:48:39 +02:00
|
|
|
|
angular
|
|
|
|
|
.module('bit.vault')
|
|
|
|
|
|
2016-09-06 06:22:47 +02:00
|
|
|
|
.controller('vaultAddSiteController', function ($scope, siteService, cipherService) {
|
2016-09-04 03:45:45 +02:00
|
|
|
|
$scope.site = {
|
|
|
|
|
folderId: null
|
|
|
|
|
};
|
|
|
|
|
|
2016-09-04 06:34:24 +02:00
|
|
|
|
$scope.createSite = function (model) {
|
2016-09-06 06:22:47 +02:00
|
|
|
|
cipherService.encryptSite(model, function (siteModel) {
|
2016-09-04 06:34:24 +02:00
|
|
|
|
var site = new Site(siteModel, true);
|
2016-09-07 02:41:17 +02:00
|
|
|
|
siteService.saveWithServer(site, function () {
|
2016-09-04 06:34:24 +02:00
|
|
|
|
$scope.close();
|
|
|
|
|
});
|
2016-09-04 03:45:45 +02:00
|
|
|
|
});
|
|
|
|
|
};
|
2016-09-04 06:34:24 +02:00
|
|
|
|
|
|
|
|
|
$scope.close = function () {
|
|
|
|
|
$scope.parentScope.closeAddSite();
|
|
|
|
|
};
|
2016-09-03 22:48:39 +02:00
|
|
|
|
});
|