diff options
| author | marktaiwan <mark.taiwan@gmail.com> | 2015-03-22 22:15:43 +0800 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2015-03-31 06:02:08 +0200 |
| commit | 6f94a0658603f3f39032655b3cebe738c2bced0d (patch) | |
| tree | b2f16bbd0305db1ed09ebd52202e3bd4dec1c93f | |
| parent | e42ffb27684e159473320c512052246f081d04f0 (diff) | |
file selector: correct typo, click event target
| -rw-r--r-- | js/file-selector.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/js/file-selector.js b/js/file-selector.js index 9869e347..fc9c83e2 100644 --- a/js/file-selector.js +++ b/js/file-selector.js @@ -141,11 +141,12 @@ $(document).on('click', '.dropzone .remove-btn', function (e) { removeFile(file); }); -$(document).on('keypress click', '.dropzone, .dropzone .file-hint', function (e) { +$(document).on('keypress click', '.dropzone', function (e) { e.stopPropagation(); - // accept mosue click or Enter - if (e.which != 1 && e.which != 13) + // accept mouse click or Enter + if ((e.which != 1 || e.target.className != 'file-hint') && + e.which != 13) return; var $fileSelector = $('<input type="file" multiple>'); |
