download-original.js: fix interactions

This commit is contained in:
czaks 2013-12-27 15:28:46 +01:00 committed by Michael Foster
parent 22869ce015
commit d7bcdfa81a

View File

@ -15,7 +15,7 @@
*/
onready(function(){
$('.postfilename').each(function() {
var do_original_filename = function() {
var filename, truncated;
if ($(this).attr('title')) {
filename = $(this).attr('title');
@ -31,5 +31,11 @@ onready(function(){
.attr('href', $(this).parent().parent().find('a').attr('href'))
.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);
});
});