mirror of
https://github.com/moparisthebest/mail
synced 2025-02-07 10:30:18 -05:00
Merge pull request #193 from whiteout-io/dev/WO-721
refactor keyfilBtn for broader usage
This commit is contained in:
commit
5b4d7bcd4a
@ -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;
|
@ -491,13 +491,4 @@ ngModule.directive('attachmentInput', function() {
|
||||
};
|
||||
});
|
||||
|
||||
ngModule.directive('attachmentBtn', function() {
|
||||
return function(scope, elm) {
|
||||
elm.on('click touchstart', function(e) {
|
||||
e.preventDefault();
|
||||
document.querySelector('#attachment-input').click();
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
module.exports = WriteCtrl;
|
@ -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">
|
||||
|
@ -48,7 +48,7 @@
|
||||
<div class="write__subject">
|
||||
<input class="input-text" ng-model="subject" spellcheck="true" tabindex="2" placeholder="Subject" ng-change="updatePreview()">
|
||||
<input id="attachment-input" type="file" multiple attachment-input>
|
||||
<button class="btn" ng-class="{'btn--invalid': sendBtnSecure === false}" attachment-btn>
|
||||
<button class="btn" ng-class="{'btn--invalid': sendBtnSecure === false}" wo-click-file-input="#attachment-input">
|
||||
<svg><use xlink:href="#icon-attachment" /><title>Add attachment</title></svg>
|
||||
</button>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user