Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (window.theme.isFirstLoad && jQuery('.wpcf7-drag-n-drop-file').length === 0) {
- document.addEventListener( 'wpcf7mailsent', function( event ) {
- // Get input type file element
- var inputFile = jQuery('.wpcf7-drag-n-drop-file');
- var $form = inputFile.parents('form');
- // Reset upload list for multiple fields
- if ( inputFile.length > 0 ) {
- jQuery.each( inputFile, function(){
- // Reset file counts
- localStorage.setItem( jQuery(this).attr('data-name') + '_count_files', 1 );
- });
- } else {
- // Reset file counts
- localStorage.setItem( inputFile.attr('data-name') + '_count_files', 1 );
- }
- // Remove status / progress bar
- jQuery('.dnd-upload-status', $form ).remove();
- jQuery('.dnd-upload-counter span', $form ).text('0');
- jQuery('span.has-error-msg', $form ).remove();
- }, false);
- }
- if (!window.theme.isFirstLoad && typeof window.initDragDrop === 'function') {
- window.initDragDrop();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement