mirror of
https://github.com/moparisthebest/mail
synced 2024-12-22 15:28:49 -05:00
refactor keyfilBtn for broader usage
This commit is contained in:
parent
c7463cd185
commit
ac7af7168b
@ -119,13 +119,4 @@ ngModule.directive('keyfileInput', function() {
|
||||
};
|
||||
});
|
||||
|
||||
ngModule.directive('keyfileBtn', function() {
|
||||
return function(scope, elm) {
|
||||
elm.on('click touchstart', function(e) {
|
||||
e.preventDefault();
|
||||
document.querySelector('#keyfile-input').click();
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
module.exports = ContactsCtrl;
|
@ -163,4 +163,14 @@ ngModule.directive('woFocusMe', function($timeout, $parse) {
|
||||
};
|
||||
});
|
||||
|
||||
ngModule.directive('woClickFileInput', function() {
|
||||
return function(scope, elm, attrs) {
|
||||
var fileInput = document.querySelector(attrs.woClickFileInput);
|
||||
elm.on('click touchstart', function(e) {
|
||||
e.preventDefault();
|
||||
fileInput.click();
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
module.exports = ngModule;
|
@ -9,7 +9,7 @@
|
||||
<input class="u-hide-visually" id="keyfile-input" type="file" multiple accept=".asc" keyfile-input>
|
||||
<div class="form-input-with-button u-gap-bottom">
|
||||
<input class="input-text" type="text" placeholder="Search..." ng-model="searchText">
|
||||
<button class="btn" ng-class="{'btn--invalid': sendBtnSecure === false}" keyfile-btn>Import keys</button>
|
||||
<button class="btn" ng-class="{'btn--invalid': sendBtnSecure === false}" wo-click-file-input="#keyfile-input">Import keys</button>
|
||||
</div>
|
||||
|
||||
<p class="typo-paragraph u-text-center" ng-show="!keys.length">
|
||||
|
Loading…
Reference in New Issue
Block a user