mirror of
https://github.com/bitwarden/browser
synced 2025-12-18 17:23:37 +00:00
Added toast config and messages when saving from vault. Persist scroll position when returning to vault from other pages.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
angular
|
||||
.module('bit.vault')
|
||||
|
||||
.controller('vaultAddSiteController', function ($scope, $state, siteService, folderService, cipherService, $q) {
|
||||
.controller('vaultAddSiteController', function ($scope, $state, $stateParams, siteService, folderService, cipherService, $q) {
|
||||
var returnScrollY = $stateParams.returnScrollY;
|
||||
|
||||
$scope.site = {
|
||||
folderId: null
|
||||
};
|
||||
@@ -39,14 +41,14 @@
|
||||
var site = new Site(siteModel, true);
|
||||
return site;
|
||||
}).then(function (site) {
|
||||
return saveSite(site, function (site) {
|
||||
alert('Saved ' + site.id + '!');
|
||||
return saveSite(site).then(function (site) {
|
||||
toastr.success('Added site');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$scope.close = function () {
|
||||
$state.go('tabs.vault', { animation: 'out-slide-down' });
|
||||
$state.go('tabs.vault', { animation: 'out-slide-down', scrollY: returnScrollY || 0 });
|
||||
};
|
||||
|
||||
function saveSite(site) {
|
||||
|
||||
Reference in New Issue
Block a user