]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
make .attachment.more ajax work with ajax-loaded content, i.e. infiniteScroll
authorHannes Mannerheim <h@nnesmannerhe.im>
Mon, 20 Oct 2014 14:14:37 +0000 (16:14 +0200)
committerHannes Mannerheim <h@nnesmannerhe.im>
Mon, 20 Oct 2014 14:14:37 +0000 (16:14 +0200)
js/util.js

index 6d2847023891ef4e31493733d3ba6d21491a9111..82ca6e4bcec149bb118742e0915b629c82c8dac7 100644 (file)
@@ -856,18 +856,16 @@ var SN = { // StatusNet
                 return;
             }
 
-            var attachment_more = notice.find('.attachment.more');
-            if (attachment_more.length > 0) {
-                $(attachment_more[0]).click(function () {
-                    var m = $(this);
-                    m.addClass(SN.C.S.Processing);
-                    $.get(m.attr('href'), {ajax: 1}, function (data) {
-                        m.parent('.e-content').html($(data).find('#attachment_view .e-content').html());
-                    });
+                       $(document).on('click','.attachment.more',function () {
+                               var m = $(this);
+                               m.addClass(SN.C.S.Processing);
+                               $.get(m.attr('href'), {ajax: 1}, function (data) {
+                                       m.parent('.e-content').html($(data).find('#attachment_view .e-content').html());
+                               });
+
+                               return false;
+                       });
 
-                    return false;
-                }).attr('title', SN.msg('showmore_tooltip'));
-            }
         },
 
         /**