1
0
mirror of https://github.com/bitwarden/browser synced 2026-01-01 16:13:27 +00:00

IE fixes and crypto shims

This commit is contained in:
Kyle Spearrin
2017-07-08 00:12:57 -04:00
parent ab12c990bc
commit b62950fa2b
14 changed files with 698 additions and 35 deletions

View File

@@ -2,7 +2,7 @@
.module('bit.organization')
.controller('organizationVaultAttachmentsController', function ($scope, apiService, $uibModalInstance, cryptoService,
cipherService, loginId, $analytics, validationService, toastr) {
cipherService, loginId, $analytics, validationService, toastr, $timeout) {
$analytics.eventTrack('organizationVaultAttachmentsController', { category: 'Modal' });
$scope.login = {};
$scope.loading = true;
@@ -31,8 +31,9 @@
var reader = new FileReader();
reader.readAsArrayBuffer(file);
reader.onload = function (evt) {
form.$loading = true;
$scope.$apply();
$timeout(function () {
form.$loading = true;
});
var key = cryptoService.getOrgKey($scope.login.organizationId);
var encFilename = cryptoService.encrypt(file.name, key);
@@ -61,8 +62,9 @@
req.responseType = 'arraybuffer';
req.onload = function (evt) {
if (!req.response) {
attachment.loading = false;
$scope.$apply();
$timeout(function () {
attachment.loading = false;
});
// error
return;
@@ -85,8 +87,9 @@
document.body.removeChild(a);
}
attachment.loading = false;
$scope.$apply();
$timeout(function () {
attachment.loading = false;
});
});
};
req.send(null);