]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix to allow any notice item with an attachment to use the overlay view
authorSarven Capadisli <csarven@status.net>
Tue, 16 Feb 2010 16:09:34 +0000 (17:09 +0100)
committerSarven Capadisli <csarven@status.net>
Tue, 16 Feb 2010 16:09:34 +0000 (17:09 +0100)
js/util.js

index 639049668c29bf4b0ef6885dec09af30aa958741..3021872d42fc3ba5e2793f6169b854f489579915 100644 (file)
@@ -404,12 +404,10 @@ var SN = { // StatusNet
         },
 
         NoticeWithAttachment: function(notice) {
-            if ($('.attachment', notice).length === 0) {
+            if (notice.find('.attachment').length === 0) {
                 return;
             }
 
-            var notice_id = notice.attr('id');
-
             $.fn.jOverlay.options = {
                 method : 'GET',
                 data : '',
@@ -429,13 +427,13 @@ var SN = { // StatusNet
                 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'});
                 return false;
             });
 
             var t;
-            $("body:not(#shownotice) #"+notice_id+" a.thumbnail").hover(
+            $("body:not(#shownotice) .notice a.thumbnail").hover(
                 function() {
                     var anchor = $(this);
                     $("a.thumbnail").children('img').hide();