summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2009-11-29 19:05:39 +0000
committerSarven Capadisli <csarven@status.net>2009-11-29 19:05:39 +0000
commitaa1bb43588d336b6d08c39ef3bd0a590d64dfe69 (patch)
tree2372b7cac0d62190adcea90c7742543a11768950
parente6c1dfcc8dd09f236dcc81b5acfe7778ac060835 (diff)
Created NoticeWithAttachment to handle jOverlay for single notice
items as opposed to running NoticeAttachments for all notices
-rw-r--r--js/util.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/js/util.js b/js/util.js
index cdc9971f1..0bd671f8d 100644
--- a/js/util.js
+++ b/js/util.js
@@ -296,6 +296,14 @@ var SN = { // StatusNet
},
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 = {
method : 'GET',
data : '',
@@ -315,13 +323,13 @@ var SN = { // StatusNet
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'});
return false;
});
var t;
- $("body:not(#shownotice) #content .notice a.thumbnail").hover(
+ $("body:not(#shownotice) #"+notice_id+" a.thumbnail").hover(
function() {
var anchor = $(this);
$("a.thumbnail").children('img').hide();