1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 16:23:44 +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:
Kyle Spearrin
2016-09-12 19:48:36 -04:00
parent ba5286c438
commit 5f39939d65
17 changed files with 154 additions and 30 deletions

View File

@@ -1,7 +1,9 @@
angular
angular
.module('bit.vault')
.controller('vaultEditSiteController', function ($scope, $state, $stateParams, siteService, folderService, cipherService, $q) {
.controller('vaultEditSiteController', function ($scope, $state, $stateParams, siteService, folderService, cipherService, $q, toastr) {
var returnScrollY = $stateParams.returnScrollY;
$scope.site = {
folderId: null
};
@@ -44,8 +46,8 @@
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('Edited site');
});
});
};
@@ -55,7 +57,7 @@
$state.go('viewSite', { siteId: $stateParams.siteId, animation: 'out-slide-down' });
}
else {
$state.go('tabs.vault', { animation: 'out-slide-down' });
$state.go('tabs.vault', { animation: 'out-slide-down', scrollY: returnScrollY || 0 });
}
};