forked from GNUsocial/gnu-social
Created NoticeWithAttachment to handle jOverlay for single notice
items as opposed to running NoticeAttachments for all notices
This commit is contained in:
parent
e6c1dfcc8d
commit
aa1bb43588
12
js/util.js
12
js/util.js
@ -296,6 +296,14 @@ var SN = { // StatusNet
|
|||||||
},
|
},
|
||||||
|
|
||||||
NoticeAttachments: function() {
|
NoticeAttachments: function() {
|
||||||
|
$('.notice a.attachment').each(function() {
|
||||||
|
SN.U.NoticeWithAttachment($(this).closest('.notice'));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
NoticeWithAttachment: function(notice) {
|
||||||
|
var notice_id = notice.attr('id');
|
||||||
|
|
||||||
$.fn.jOverlay.options = {
|
$.fn.jOverlay.options = {
|
||||||
method : 'GET',
|
method : 'GET',
|
||||||
data : '',
|
data : '',
|
||||||
@ -315,13 +323,13 @@ var SN = { // StatusNet
|
|||||||
css : {'max-width':'542px', 'top':'5%', 'left':'32.5%'}
|
css : {'max-width':'542px', 'top':'5%', 'left':'32.5%'}
|
||||||
};
|
};
|
||||||
|
|
||||||
$('#content .notice a.attachment').click(function() {
|
$('#'+notice_id+' 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) #content .notice a.thumbnail").hover(
|
$("body:not(#shownotice) #"+notice_id+" a.thumbnail").hover(
|
||||||
function() {
|
function() {
|
||||||
var anchor = $(this);
|
var anchor = $(this);
|
||||||
$("a.thumbnail").children('img').hide();
|
$("a.thumbnail").children('img').hide();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user