diff --git a/js/download-original.js b/js/download-original.js index cf9635ac..06cd1c64 100644 --- a/js/download-original.js +++ b/js/download-original.js @@ -15,16 +15,16 @@ * */ -onready(function(){ - var do_original_filename = function() { - var filename, truncated; +onready(function() { + let doOriginalFilename = function() { + let filename, truncated; if ($(this).attr('title')) { filename = $(this).attr('title'); truncated = true; } else { filename = $(this).text(); } - + $(this).replaceWith( $('') .attr('download', filename) @@ -34,9 +34,9 @@ onready(function(){ ); }; - $('.postfilename').each(do_original_filename); + $('.postfilename').each(doOriginalFilename); - $(document).on('new_post', function(e, post) { - $(post).find('.postfilename').each(do_original_filename); + $(document).on('new_post', function(e, post) { + $(post).find('.postfilename').each(doOriginalFilename); }); });