1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +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,7 @@
angular
.module('bit')
.config(function ($stateProvider, $urlRouterProvider, $httpProvider, jwtInterceptorProvider) {
.config(function ($stateProvider, $urlRouterProvider, $httpProvider, jwtInterceptorProvider, toastrConfig) {
jwtInterceptorProvider.urlParam = 'access_token';
jwtInterceptorProvider.tokenGetter = /*@ngInject*/ function (config, appSettings, tokenService) {
if (config.url.indexOf(appSettings.apiUri) === 0) {
@@ -11,6 +11,13 @@
}
};
angular.extend(toastrConfig, {
closeButton: true,
progressBar: true,
showMethod: 'slideDown',
positionClass: 'toast-bottom-center'
});
if ($httpProvider.defaults.headers.post) {
$httpProvider.defaults.headers.post = {};
}
@@ -56,7 +63,8 @@
.state('tabs.vault', {
url: "/vault",
templateUrl: "app/vault/views/vault.html",
controller: 'vaultController'
controller: 'vaultController',
params: { scrollY: 0 }
})
.state('tabs.settings', {
url: "/settings",
@@ -74,21 +82,21 @@
templateUrl: "app/vault/views/vaultViewSite.html",
controller: 'vaultViewSiteController',
data: { authorize: true },
params: { animation: null }
params: { animation: null, returnScrollY: 0 }
})
.state('addSite', {
url: "/add-site",
templateUrl: "app/vault/views/vaultAddSite.html",
controller: 'vaultAddSiteController',
data: { authorize: true },
params: { animation: null }
params: { animation: null, returnScrollY: 0 }
})
.state('editSite', {
url: "/edit-site?siteId",
templateUrl: "app/vault/views/vaultEditSite.html",
controller: 'vaultEditSiteController',
data: { authorize: true },
params: { animation: null, fromView: true }
params: { animation: null, fromView: true, returnScrollY: 0 }
});
})
.run(function ($rootScope, userService, loginService, tokenService, $state) {