1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-06 09:20:43 +01:00

Expand vault all tabs. Search from curr. tab page.

This commit is contained in:
Kyle Spearrin 2017-09-27 20:12:19 -04:00
parent 1fa3df1151
commit 41dda3bb61
9 changed files with 39 additions and 19 deletions

View File

@ -112,7 +112,7 @@
url: '/vault', url: '/vault',
templateUrl: 'app/vault/views/vault.html', templateUrl: 'app/vault/views/vault.html',
controller: 'vaultController', controller: 'vaultController',
params: { syncOnLoad: false } params: { syncOnLoad: false, searchText: null }
}) })
.state('tabs.settings', { .state('tabs.settings', {
url: '/settings', url: '/settings',

View File

@ -12,6 +12,8 @@ angular
$scope.logins = []; $scope.logins = [];
$scope.loaded = false; $scope.loaded = false;
$scope.searchText = null;
$('#search').focus();
$scope.$on('$viewContentLoaded', function () { $scope.$on('$viewContentLoaded', function () {
$timeout(loadVault, 100); $timeout(loadVault, 100);
@ -101,6 +103,12 @@ angular
return login.localData && login.localData.lastUsedDate ? -1 * login.localData.lastUsedDate : 0; return login.localData && login.localData.lastUsedDate ? -1 * login.localData.lastUsedDate : 0;
}; };
$scope.searchVault = function () {
$state.go('tabs.vault', {
searchText: $scope.searchText
});
};
$scope.$on('syncCompleted', function (event, successfully) { $scope.$on('syncCompleted', function (event, successfully) {
if ($scope.loaded) { if ($scope.loaded) {
setTimeout(loadVault, 500); setTimeout(loadVault, 500);

View File

@ -1,8 +1,14 @@
<div class="header"> <div class="header header-search">
<div class="left">
<a href="" ng-click="main.expandVault()"><i class="fa fa-external-link fa-rotate-270 fa-lg"></i></a>
</div>
<div class="search" ng-style="{'visibility': main.disableSearch ? 'hidden' : 'visible'}">
<input type="search" placeholder="{{i18n.searchVault}}" id="search" ng-model="searchText" ng-change="searchVault()" />
<i class="fa fa-search"></i>
</div>
<div class="right"> <div class="right">
<a href="" ng-click="addLogin()"><i class="fa fa-plus fa-lg"></i></a> <a href="" ng-click="addLogin()"><i class="fa fa-plus fa-lg"></i></a>
</div> </div>
<div class="title">{{i18n.currentTab}}</div>
</div> </div>
<div class="content content-tabs"> <div class="content content-tabs">
<div ng-if="logins.length"> <div ng-if="logins.length">

View File

@ -9,6 +9,7 @@ angular
self.xsBody = $window.screen.availHeight < 600; self.xsBody = $window.screen.availHeight < 600;
self.smBody = !self.xsBody && $window.screen.availHeight <= 800; self.smBody = !self.xsBody && $window.screen.availHeight <= 800;
self.lgBody = !self.xsBody && !self.smBody && utilsService && !utilsService.isFirefox() && !utilsService.isEdge(); self.lgBody = !self.xsBody && !self.smBody && utilsService && !utilsService.isFirefox() && !utilsService.isEdge();
self.disableSearch = utilsService.isEdge();
$scope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState, fromParams) { $scope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState, fromParams) {
if (toParams.animation) { if (toParams.animation) {
@ -20,6 +21,11 @@ angular
} }
}); });
self.expandVault = function (e) {
$analytics.eventTrack('Expand Vault');
chrome.tabs.create({ url: $window.location.href });
};
chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) { chrome.runtime.onMessage.addListener(function (msg, sender, sendResponse) {
if (msg.command === 'syncCompleted') { if (msg.command === 'syncCompleted') {
$scope.$broadcast('syncCompleted', msg.successfully); $scope.$broadcast('syncCompleted', msg.successfully);

View File

@ -1,4 +1,7 @@
<div class="header"> <div class="header">
<div class="left">
<a href="" ng-click="main.expandVault()"><i class="fa fa-external-link fa-rotate-270 fa-lg"></i></a>
</div>
<div class="title">{{i18n.settings}}</div> <div class="title">{{i18n.settings}}</div>
</div> </div>
<div class="content content-tabs"> <div class="content content-tabs">

View File

@ -1,4 +1,7 @@
<div class="header"> <div class="header">
<div class="left">
<a href="" ng-click="main.expandVault()"><i class="fa fa-external-link fa-rotate-270 fa-lg"></i></a>
</div>
<div class="title">{{i18n.tools}}</div> <div class="title">{{i18n.tools}}</div>
</div> </div>
<div class="content content-tabs"> <div class="content content-tabs">

View File

@ -9,7 +9,6 @@
$scope.i18n = i18nService; $scope.i18n = i18nService;
$scope.showFolderCounts = !utilsService.isEdge(); $scope.showFolderCounts = !utilsService.isEdge();
$scope.showOnlyFolderView = utilsService.isEdge(); $scope.showOnlyFolderView = utilsService.isEdge();
$scope.disableSearch = utilsService.isEdge();
$('#search').focus(); $('#search').focus();
var syncOnLoad = $stateParams.syncOnLoad; var syncOnLoad = $stateParams.syncOnLoad;
@ -84,8 +83,8 @@
} }
$scope.searchText = null; $scope.searchText = null;
if (state.searchText) { if (state.searchText || $stateParams.searchText) {
$scope.searchText = state.searchText; $scope.searchText = state.searchText || $stateParams.searchText;
} }
$scope.folderSort = function (item) { $scope.folderSort = function (item) {
@ -158,11 +157,6 @@
$timeout(loadVault, 500); $timeout(loadVault, 500);
}); });
$scope.expandVault = function (e) {
$analytics.eventTrack('Expand Vault');
chrome.tabs.create({ url: '/popup/index.html#!/tab/vault' });
};
function storeState() { function storeState() {
stateService.saveState(stateKey, { stateService.saveState(stateKey, {
scrollY: getScrollY(), scrollY: getScrollY(),

View File

@ -1,9 +1,9 @@
<div class="header header-search"> <div class="header header-search">
<div class="left"> <div class="left">
<a href="" ng-click="expandVault()"><i class="fa fa-external-link fa-rotate-270 fa-lg"></i></a> <a href="" ng-click="main.expandVault()"><i class="fa fa-external-link fa-rotate-270 fa-lg"></i></a>
</div> </div>
<div class="search" ng-style="{'visibility': disableSearch ? 'hidden' : 'visible'}"> <div class="search" ng-style="{'visibility': main.disableSearch ? 'hidden' : 'visible'}">
<input type="search" placeholder="{{i18n.searchVault}}" ng-model="searchText" id="search" /> <input type="search" placeholder="{{i18n.searchVault}}" id="search" ng-model="searchText" />
<i class="fa fa-search"></i> <i class="fa fa-search"></i>
</div> </div>
<div class="right"> <div class="right">

View File

@ -54,6 +54,11 @@
display: block; display: block;
float: left; float: left;
} }
.fa-external-link {
vertical-align: 0;
margin: 0 -5px 0 5px;
}
} }
.right { .right {
@ -117,11 +122,6 @@
white-space: nowrap; white-space: nowrap;
float: none; float: none;
} }
.fa-external-link {
vertical-align: 0;
margin: 0 -5px 0 5px;
}
} }
} }