download-original.js: fix interactions

This commit is contained in:
czaks 2013-12-27 15:28:46 +01:00
parent ab661f9a5c
commit 557fbe91b4

View File

@ -15,7 +15,7 @@
*/ */
onready(function(){ onready(function(){
$('.postfilename').each(function() { var do_original_filename = function() {
var filename, truncated; var filename, truncated;
if ($(this).attr('title')) { if ($(this).attr('title')) {
filename = $(this).attr('title'); filename = $(this).attr('title');
@ -31,5 +31,11 @@ onready(function(){
.attr('href', $(this).parent().parent().find('a').attr('href')) .attr('href', $(this).parent().parent().find('a').attr('href'))
.attr('title', _('Save as original filename') + (truncated ? ' (' + filename + ')' : '')) .attr('title', _('Save as original filename') + (truncated ? ' (' + filename + ')' : ''))
); );
};
$('.postfilename').each(do_original_filename);
$(document).bind('new_post', function(e, post) {
$(post).find('.postfilename').each(do_original_filename);
}); });
}); });