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

disable issues on edge

This commit is contained in:
Kyle Spearrin 2017-08-29 09:30:19 -04:00
parent bf703b6880
commit a18e17749f
3 changed files with 22 additions and 12 deletions

View File

@ -7,6 +7,8 @@
state = stateService.getState(stateKey) || {}; state = stateService.getState(stateKey) || {};
$scope.i18n = i18nService; $scope.i18n = i18nService;
$scope.showFolderCounts = !utilsService.isEdge();
$scope.disableSearch = utilsService.isEdge();
$('#search').focus(); $('#search').focus();
var syncOnLoad = $stateParams.syncOnLoad; var syncOnLoad = $stateParams.syncOnLoad;
@ -60,16 +62,18 @@
$rootScope.vaultFolders = decFolders; $rootScope.vaultFolders = decFolders;
$rootScope.vaultLogins = decLogins; $rootScope.vaultLogins = decLogins;
// compute item count for each folder if ($scope.showFolderCounts) {
for (var i = 0; i < decFolders.length; i++) { // compute item count for each folder
var itemCount = 0; for (var i = 0; i < decFolders.length; i++) {
for (var j = 0; j < decLogins.length; j++) { var itemCount = 0;
if (decLogins[j].folderId === decFolders[i].id) { for (var j = 0; j < decLogins.length; j++) {
itemCount++; if (decLogins[j].folderId === decFolders[i].id) {
itemCount++;
}
} }
}
$rootScope.vaultFolders[i].itemCount = itemCount; $rootScope.vaultFolders[i].itemCount = itemCount;
}
} }
if (!delayLoad) { if (!delayLoad) {

View File

@ -2,7 +2,7 @@
.module('bit.vault') .module('bit.vault')
.controller('vaultViewFolderController', function ($scope, loginService, folderService, $q, $state, $stateParams, toastr, .controller('vaultViewFolderController', function ($scope, loginService, folderService, $q, $state, $stateParams, toastr,
syncService, $analytics, i18nService, stateService) { syncService, $analytics, i18nService, stateService, utilsService) {
var stateKey = 'viewFolder', var stateKey = 'viewFolder',
state = stateService.getState(stateKey) || {}; state = stateService.getState(stateKey) || {};
@ -41,7 +41,13 @@
var loginPromise = $q.when(loginService.getAllDecryptedForFolder($scope.folder.id)); var loginPromise = $q.when(loginService.getAllDecryptedForFolder($scope.folder.id));
loginPromise.then(function (logins) { loginPromise.then(function (logins) {
decLogins = logins.sort(loginSort); if (utilsService.isEdge()) {
// Edge is super slow at sorting
decLogins = logins;
}
else {
decLogins = logins.sort(loginSort);
}
}); });
promises.push(loginPromise); promises.push(loginPromise);

View File

@ -3,7 +3,7 @@
<a href="" ng-click="expandVault()"><i class="fa fa-external-link fa-rotate-270 fa-lg"></i></a> <a href="" ng-click="expandVault()"><i class="fa fa-external-link fa-rotate-270 fa-lg"></i></a>
</div> </div>
<div class="search"> <div class="search">
<input type="search" placeholder="{{i18n.searchVault}}" ng-model="searchText" id="search" /> <input type="search" placeholder="{{i18n.searchVault}}" ng-model="searchText" id="search" ng-disabled="disableSearch" />
<i class="fa fa-search"></i> <i class="fa fa-search"></i>
</div> </div>
<div class="right"> <div class="right">
@ -22,7 +22,7 @@
ng-repeat="folder in vaultFolders | orderBy: folderSort track by $index"> ng-repeat="folder in vaultFolders | orderBy: folderSort track by $index">
{{folder.name}} {{folder.name}}
<i class="fa fa-chevron-right fa-lg"></i> <i class="fa fa-chevron-right fa-lg"></i>
<span class="item-sub-label">{{folder.itemCount}}</span> <span class="item-sub-label" ng-if="showFolderCounts">{{folder.itemCount}}</span>
</a> </a>
</div> </div>
</div> </div>