]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Created NoticeWithAttachment to handle jOverlay for single notice
authorSarven Capadisli <csarven@status.net>
Sun, 29 Nov 2009 19:05:39 +0000 (19:05 +0000)
committerSarven Capadisli <csarven@status.net>
Sun, 29 Nov 2009 19:05:39 +0000 (19:05 +0000)
items as opposed to running NoticeAttachments for all notices

js/util.js

index cdc9971f18aad131fd9b1fe0d2ce4f51c4e9be7f..0bd671f8dffd0d268bd6bc91dfa595522ced7994 100644 (file)
@@ -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();