Archive: Namaste PHP AMQP framework v1.0 (2017-2020)
952 days continuous production uptime, 40k+ tp/s single node. Original corpo Bitbucket history not included — clean archive commit.
This commit is contained in:
22
html/js/modules (optional)/file-input.js
Executable file
22
html/js/modules (optional)/file-input.js
Executable file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
/** *****************
|
||||
* File input *
|
||||
******************/
|
||||
(function ($) {
|
||||
|
||||
$(document).on('change', '.file-field input[type="file"]', function (e) {
|
||||
|
||||
var $this = $(e.target);
|
||||
var $file_field = $this.closest('.file-field');
|
||||
var $path_input = $file_field.find('input.file-path');
|
||||
var files = $this[0].files;
|
||||
var file_names = [];
|
||||
for (var i = 0; i < files.length; i++) {
|
||||
var file_name = files[i].name;
|
||||
file_names.push(file_name);
|
||||
}
|
||||
$path_input.val(file_names.join(', '));
|
||||
$path_input.trigger('change');
|
||||
});
|
||||
})(jQuery);
|
||||
Reference in New Issue
Block a user