浏览代码

Adding colorbox for images within heartbeat stream

logicp 8 年之前
父节点
当前提交
e0bf6069c6
共有 2 个文件被更改,包括 13 次插入1 次删除
  1. 8 1
      js/heartbeat.js
  2. 5 0
      js/jquery.colorbox-min.js

+ 8 - 1
js/heartbeat.js

@@ -75,8 +75,10 @@
                 });
               }
             }
+
+            listenImages();
         }
-    }
+    };
 
 
   function updateFeed() {
@@ -89,7 +91,12 @@
         console.log('We are succeed!');
       }
     })
+  }
 
+  function listenImages() {
+    $('.heartbeat-content').find('img').each(function() {
+      $(this).colorbox({href: $(this).attr('src')});
+    });
   }
 
 })(jQuery, Drupal, drupalSettings);

文件差异内容过多而无法显示
+ 5 - 0
js/jquery.colorbox-min.js


部分文件因为文件数量过多而无法显示