Skip to content

Instantly share code, notes, and snippets.

@readysetawesome
Created February 28, 2012 17:56
Show Gist options
  • Save readysetawesome/1933993 to your computer and use it in GitHub Desktop.
Save readysetawesome/1933993 to your computer and use it in GitHub Desktop.
Make comments "fall off" in Joomla plugin
-<script type="text/javascript">var livefyre_blogtype='joomla';</script>
+<script type="text/javascript">
+ var livefyre_blogtype='joomla';
+ var customLivefyreDelegates = {
+ handle_comment_shown: function(data) {
+ var max_comment_length = 200,
+ cid = data.comment.attr('comment_id'),
+ models = LF.Comments.models,
+ len = models.length;
+ if (len > max_comment_length) {
+ if ( $jl.cursor == null || cid == $jl.cursor.split(':')[1] ) {
+ $jl.cursor = 'id:' + models[len-2].id;
+ }
+ models[len-1].remove();
+ LF.Helpers.initShowMore();
+ }
+ }
+ };
+
+ LF.ready(function() {
+ LF.Dispatcher.addListener(customLivefyreDelegates);
+ });
+</script>
<div id='lf_comment_stream' livefyre_title="<?php echo $articleTitle; ?>">
<?php
//use show_partial
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment