1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

password generator from vault add/edit

This commit is contained in:
Kyle Spearrin
2016-09-19 22:24:55 -04:00
parent 6ef3ff9f4d
commit e5c58c12fe
8 changed files with 89 additions and 18 deletions

View File

@@ -4,7 +4,7 @@
.controller('vaultAddSiteController', function ($scope, $state, $stateParams, siteService, folderService, cryptoService, $q, toastr) {
var returnScrollY = $stateParams.returnScrollY;
var returnSearchText = $stateParams.returnSearchText;
var fromCurrent = $stateParams.uri !== null;
var fromCurrent = $stateParams.fromCurrent || $stateParams.uri !== null;
$scope.site = {
folderId: null,
@@ -12,7 +12,11 @@
uri: $stateParams.uri
};
if ($scope.site.name && $scope.site.uri) {
if ($stateParams.site) {
angular.extend($scope.site, $stateParams.site);
}
if (!$stateParams.site && $scope.site.name && $scope.site.uri) {
$('#username').focus();
}
else {
@@ -52,4 +56,16 @@
});
}
};
$scope.generatePassword = function () {
$state.go('passwordGenerator', {
animation: 'in-slide-up',
addState: {
fromCurrent: fromCurrent,
site: $scope.site,
returnScrollY: returnScrollY,
returnSearchText: returnSearchText
}
});
};
});