Browse Source

bugfix: work with truncated filenames

pull/40/head
Michael Foster 11 years ago
parent
commit
c567131ca7
  1. 12
      js/download-original.js

12
js/download-original.js

@ -16,12 +16,20 @@
onready(function(){
$('.postfilename').each(function() {
var filename, truncated;
if ($(this).attr('title')) {
filename = $(this).attr('title');
truncated = true;
} else {
filename = $(this).text();
}
$(this).replaceWith(
$('<a></a>')
.attr('download', $(this).text())
.attr('download', filename)
.append($(this).contents())
.attr('href', $(this).parent().parent().find('a').attr('href'))
.attr('title', _('Save as original filename'))
.attr('title', _('Save as original filename') + (truncated ? ' (' + filename + ')' : ''))
);
});
});

Loading…
Cancel
Save