mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-24 23:50:11 +01:00
Adds keyboard focus to file selector
This commit is contained in:
parent
7f1ebb2595
commit
8fe4c70223
@ -135,13 +135,21 @@ var dropHandlers = {
|
||||
$(document).on(dropHandlers, '.dropzone');
|
||||
|
||||
$(document).on('click', '.dropzone .remove-btn', function (e) {
|
||||
e.stopPropagation();
|
||||
|
||||
var file = $(e.target).parent().data('file-ref');
|
||||
|
||||
getThumbElement(file).remove();
|
||||
removeFile(file);
|
||||
});
|
||||
|
||||
$(document).on('click', '.dropzone .file-hint', function (e) {
|
||||
$(document).on('keypress click', '.dropzone, .dropzone .file-hint', function (e) {
|
||||
e.stopPropagation();
|
||||
|
||||
// accept mosue click or Enter
|
||||
if (e.which != 1 || e.which != 13)
|
||||
return;
|
||||
|
||||
var $fileSelector = $('<input type="file" multiple>');
|
||||
|
||||
$fileSelector.on('change', function (e) {
|
||||
|
@ -92,7 +92,7 @@
|
||||
<td>
|
||||
<input type="file" name="file" id="upload_file">
|
||||
<div class="dropzone-wrap" style="display: none;">
|
||||
<div class="dropzone">
|
||||
<div class="dropzone" tabindex="0">
|
||||
<div class="file-hint">Select/drop/paste files here</div>
|
||||
<div class="file-thumbs"></div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user