Change file delete checkbox to button

This commit is contained in:
Kijin Sung 2024-10-09 02:46:48 +09:00
parent 453f83db7d
commit 7fe2203cbd
2 changed files with 45 additions and 22 deletions

View file

@ -0,0 +1,17 @@
'use strict';
(function($) {
$(function() {
$('button.evFileRemover').on('click', function() {
const container = $(this).parents('.ev_file_upload');
container.find('span.filename').text('');
container.find('span.filesize').text('');
container.find('input[type=hidden][name^=_delete_]').val('Y');
container.find('input[type=file]').val('');
});
$('input.rx_ev_file').on('change', function() {
const container = $(this).parents('.ev_file_upload');
container.find('input[type=hidden][name^=_delete_]').val('N');
});
});
})(jQuery);