summaryrefslogtreecommitdiff
path: root/fbin/templates/upload.html
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2019-12-06 21:21:50 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2019-12-06 21:21:50 +0100
commit386c0f4bc68b05157cb3ee80872ea6daa26478ad (patch)
tree657d4a74f2e1107cf78c39fa61d36ee77de24cef /fbin/templates/upload.html
parent909ed54493d6bc9ef225899b53affb3e7da20925 (diff)
Change bootstrap-filestyle name on drop or paste
This makes sure the upload form is visually updated when dropping or pasting a file.
Diffstat (limited to 'fbin/templates/upload.html')
-rw-r--r--fbin/templates/upload.html2
1 files changed, 2 insertions, 0 deletions
diff --git a/fbin/templates/upload.html b/fbin/templates/upload.html
index 00f4de8..ccca30b 100644
--- a/fbin/templates/upload.html
+++ b/fbin/templates/upload.html
@@ -54,12 +54,14 @@ $(document).ready(function() {
$('#dropzone').removeClass('drop-active drop-invalid');
if (event.originalEvent.dataTransfer.files.length == 1) {
$(':file')[0].files = event.originalEvent.dataTransfer.files;
+ $('.bootstrap-filestyle input').val(event.originalEvent.dataTransfer.files[0].name);
}
});
$(document).on('paste', function(event) {
var files = (event.clipboardData || event.originalEvent.clipboardData).files;
if (files.length === 1) {
$(':file')[0].files = files;
+ $('.bootstrap-filestyle input').val(files[0].name);
}
});
});