Merge branch 'replaceApply'

This commit is contained in:
brantje 2016-09-30 21:58:06 +02:00
commit eae47eaa38
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F
5 changed files with 10 additions and 8 deletions

View file

@ -81,11 +81,13 @@ jQuery(document).ready(function () {
jQuery(document).on('click', '.undoDelete', function () { jQuery(document).on('click', '.undoDelete', function () {
var credential = findItemByID($(this).attr('data-item-id')); var credential = findItemByID($(this).attr('data-item-id'));
angular.element('#app-content-wrapper').scope().recoverCredential(credential); angular.element('#app-content-wrapper').scope().recoverCredential(credential);
//Outside anglular we need $apply
angular.element('#app-content-wrapper').scope().$apply(); angular.element('#app-content-wrapper').scope().$apply();
}); });
jQuery(document).on('click', '.undoRestore', function () { jQuery(document).on('click', '.undoRestore', function () {
var credential = findItemByID($(this).attr('data-item-id')); var credential = findItemByID($(this).attr('data-item-id'));
angular.element('#app-content-wrapper').scope().deleteCredential(credential); angular.element('#app-content-wrapper').scope().deleteCredential(credential);
//Outside anglular we need $apply
angular.element('#app-content-wrapper').scope().$apply(); angular.element('#app-content-wrapper').scope().$apply();
}); });
var adjustControlsWidth = function(r) { var adjustControlsWidth = function(r) {

View file

@ -169,7 +169,7 @@ angular.module('passmanApp')
}); });
$scope.$apply() $scope.$digest()
}; };
$scope.fileLoadError = function (error, file) { $scope.fileLoadError = function (error, file) {
@ -181,7 +181,7 @@ angular.module('passmanApp')
$scope.fileSelectProgress = function (progress) { $scope.fileSelectProgress = function (progress) {
if (progress) { if (progress) {
$scope.fileprogress = progress; $scope.fileprogress = progress;
$scope.$apply() $scope.$digest()
} }
}; };
@ -208,7 +208,7 @@ angular.module('passmanApp')
qrInfo[parsedQR[3]] = parsedQR[4]; qrInfo[parsedQR[3]] = parsedQR[4];
qrInfo[parsedQR[5]] = parsedQR[6]; qrInfo[parsedQR[5]] = parsedQR[6];
$scope.storedCredential.otp = qrInfo; $scope.storedCredential.otp = qrInfo;
$scope.$apply() $scope.$digest()
}; };
$scope.saveCredential = function () { $scope.saveCredential = function () {

View file

@ -40,7 +40,7 @@ angular.module('passmanApp')
file_data = file.data.split(','); file_data = file.data.split(',');
file_data = decodeURIComponent(escape(window.atob( file_data[1] ))); //window.atob(); file_data = decodeURIComponent(escape(window.atob( file_data[1] ))); //window.atob();
_log('File read successfully!') _log('File read successfully!')
$scope.$apply(); $scope.$digest();
}; };
$scope.fileLoadError = function (file) { $scope.fileLoadError = function (file) {
@ -121,7 +121,7 @@ angular.module('passmanApp')
} }
}).progress(function(progress){ }).progress(function(progress){
$scope.file_read_progress = progress; $scope.file_read_progress = progress;
$scope.$apply(); $scope.$digest();
}); });
} }
} }

View file

@ -16,7 +16,7 @@ angular.module('passmanApp')
ShareService.generateRSAKeys(length).progress(function(progress){ ShareService.generateRSAKeys(length).progress(function(progress){
$scope.progress = progress > 0 ? 2:1; $scope.progress = progress > 0 ? 2:1;
$scope.$apply(); $scope.$digest();
}).then(function(kp){ }).then(function(kp){
console.log('stuff done'); console.log('stuff done');
$scope.generating = false; $scope.generating = false;

View file

@ -75,13 +75,13 @@ angular.module('passmanApp')
ShareService.generateRSAKeys(key_size).progress(function (progress) { ShareService.generateRSAKeys(key_size).progress(function (progress) {
var p = progress > 0 ? 2 : 1; var p = progress > 0 ? 2 : 1;
$scope.creating_keys = 'Generating sharing keys (' + p + ' / 2)'; $scope.creating_keys = 'Generating sharing keys (' + p + ' / 2)';
$scope.$apply(); $scope.$digest();
}).then(function (kp) { }).then(function (kp) {
var pem = ShareService.rsaKeyPairToPEM(kp); var pem = ShareService.rsaKeyPairToPEM(kp);
$scope.creating_keys = false; $scope.creating_keys = false;
$scope.sharing_keys.private_sharing_key = pem.privateKey; $scope.sharing_keys.private_sharing_key = pem.privateKey;
$scope.sharing_keys.public_sharing_key = pem.publicKey; $scope.sharing_keys.public_sharing_key = pem.publicKey;
$scope.$apply(); $scope.$digest();
}); });
}; };