Prechádzať zdrojové kódy

Adding colourbox gallery option

logicp 7 rokov pred
rodič
commit
a31f759c57
2 zmenil súbory, kde vykonal 4 pridanie a 2 odobranie
  1. 3 1
      js/heartbeat.js
  2. 1 1
      templates/heartbeat-stream.html.twig

+ 3 - 1
js/heartbeat.js

@@ -103,7 +103,9 @@
     };
 
     $('.heartbeat-content').find('img').each(function() {
-      $(this).colorbox({href: $(this).attr('src'), cboxOptions});
+      let parentClass = $(this).parent().prop('className');
+      let phid = parentClass.substring(parentClass.indexOf('hid') + 4);
+      $(this).colorbox({rel: phid, href: $(this).attr('src'), cboxOptions});
     });
   }
 

+ 1 - 1
templates/heartbeat-stream.html.twig

@@ -31,7 +31,7 @@
           {{ message.user }}
           <div class="time-ago">{{ message.timeAgo }}</div>
         </div>
-        <div class="heartbeat-content">
+        <div class="heartbeat-content hid-{{ message.id }}">
         {{ message.heartbeat }}
         </div>
       </div>