mirror of
https://github.com/marcogll/soul23_placeholder_site_server.git
synced 2026-01-13 21:35:18 +00:00
feat: Add initial project structure with HTML, CSS, JavaScript libraries, and image assets.
This commit is contained in:
22
js/modules/default-file-input.js
Normal file
22
js/modules/default-file-input.js
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
(function ($) {
|
||||
$('.input-default-wrapper').on('change', '.input-default-js', function (e) {
|
||||
|
||||
var $this = $(e.target),
|
||||
$label = $this.next('label'),
|
||||
$files = $this[0].files;
|
||||
var fileName = '';
|
||||
|
||||
if ($files && $files.length > 1) {
|
||||
fileName = ($this.attr('data-multiple-target') || '').replace('{target}', $files.length);
|
||||
} else if (e.target.value) {
|
||||
fileName = e.target.value.split('\\').pop();
|
||||
}
|
||||
if (fileName) {
|
||||
$label.find('.span-choose-file').html(fileName);
|
||||
} else {
|
||||
$label.html($label.html());
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
Reference in New Issue
Block a user