Fix to allow any notice item with an attachment to use the overlay view

This commit is contained in:
Sarven Capadisli 2010-02-16 17:09:34 +01:00
parent f414544d0d
commit 3b8d060c29

View File

@ -404,12 +404,10 @@ var SN = { // StatusNet
}, },
NoticeWithAttachment: function(notice) { NoticeWithAttachment: function(notice) {
if ($('.attachment', notice).length === 0) { if (notice.find('.attachment').length === 0) {
return; return;
} }
var notice_id = notice.attr('id');
$.fn.jOverlay.options = { $.fn.jOverlay.options = {
method : 'GET', method : 'GET',
data : '', data : '',
@ -429,13 +427,13 @@ var SN = { // StatusNet
css : {'max-width':'542px', 'top':'5%', 'left':'32.5%'} css : {'max-width':'542px', 'top':'5%', 'left':'32.5%'}
}; };
$('#'+notice_id+' a.attachment').click(function() { notice.find('a.attachment').click(function() {
$().jOverlay({url: $('address .url')[0].href+'attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/ajax'}); $().jOverlay({url: $('address .url')[0].href+'attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/ajax'});
return false; return false;
}); });
var t; var t;
$("body:not(#shownotice) #"+notice_id+" a.thumbnail").hover( $("body:not(#shownotice) .notice a.thumbnail").hover(
function() { function() {
var anchor = $(this); var anchor = $(this);
$("a.thumbnail").children('img').hide(); $("a.thumbnail").children('img').hide();