1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

sort current tab by last used

This commit is contained in:
Kyle Spearrin 2017-08-29 13:15:27 -04:00
parent e01f3fd40c
commit 926e87c6fe
2 changed files with 6 additions and 1 deletions

View File

@ -94,6 +94,10 @@ angular
return url && url.startsWith(login.uri) ? 0 : 1; return url && url.startsWith(login.uri) ? 0 : 1;
}; };
$scope.sortLastUsed = function (login) {
return login.localData && login.localData.lastUsedDate ? -1 * login.localData.lastUsedDate : 0;
};
$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

@ -10,7 +10,8 @@
<div class="list-grouped"> <div class="list-grouped">
<a href="#" stop-click ng-click="fillLogin(login)" class="list-grouped-item condensed" <a href="#" stop-click ng-click="fillLogin(login)" class="list-grouped-item condensed"
title="{{i18n.autoFill}} {{login.name}}" title="{{i18n.autoFill}} {{login.name}}"
ng-repeat="login in theLogins = (logins | orderBy: [sortUriMatch, 'name', 'username']) track by $index"> ng-repeat="login in theLogins = (logins | orderBy: [sortUriMatch, sortLastUsed, 'name', 'username'])
track by $index">
<span class="btn-list" stop-prop stop-click title="{{i18n.copyPassword}}" <span class="btn-list" stop-prop stop-click title="{{i18n.copyPassword}}"
ngclipboard ngclipboard-error="clipboardError(e)" ngclipboard ngclipboard-error="clipboardError(e)"
ngclipboard-success="clipboardSuccess(e, i18n.password)" ngclipboard-success="clipboardSuccess(e, i18n.password)"