Skip to content
Snippets Groups Projects
Commit 9c8adc65 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Login: file chooser must be opened by controller, not by HTML element itself - Fix issue #886

parent 132b4aae
No related branches found
No related tags found
No related merge requests found
......@@ -43,7 +43,7 @@ function LoginController($scope, $timeout, $controller, csWallet) {
}
function LoginModalController($scope, $timeout, $q, $ionicPopover, CryptoUtils, csCrypto, ionicReady,
function LoginModalController($scope, $timeout, $q, $ionicPopover, $document, CryptoUtils, csCrypto, ionicReady,
UIUtils, BMA, Modals, csSettings, Device, parameters) {
'ngInject';
......@@ -544,6 +544,16 @@ function LoginModalController($scope, $timeout, $q, $ionicPopover, CryptoUtils,
});
};
/**
* On the file chooser
*/
$scope.openFileChooser = function() {
var elements = angular.element(document.getElementById('loginImportFile'));
if (elements && elements.length) {
elements[0].click();
}
}
/**
* On file drop
*/
......
......@@ -8,8 +8,7 @@
</div>
<div dropzone="onKeyFileDrop(file)">
<div ng-if="!formData.file"
onclick="angular.element(document.querySelector('#loginImportFile'))[0].click();">
<div ng-if="!formData.file" ng-click="openFileChooser()">
<h2 class="gray" translate>COMMON.CHOOSE_FILE</h2>
<input type="file" id="loginImportFile" accept=".dunikey,.yml"
style="visibility:hidden; position:absolute;"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment