From f6769a0f12b7ec1ae6e32185bfc2224ff77b539f Mon Sep 17 00:00:00 2001 From: Evandro Jr Date: Mon, 21 Jul 2014 12:09:55 -0300 Subject: [PATCH] toggle comment and view article is now working --- plugins/comment_paragraph/public/comment_paragraph.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/plugins/comment_paragraph/public/comment_paragraph.js b/plugins/comment_paragraph/public/comment_paragraph.js index 16eaa63..4e7ad53 100644 --- a/plugins/comment_paragraph/public/comment_paragraph.js +++ b/plugins/comment_paragraph/public/comment_paragraph.js @@ -1,7 +1,20 @@ function makeCommentable() { paragraphsTxt="" + + foundCommentableParagraph = false; + jQuery('#article_body_ifr').contents().find('body').children('div.article_comments').each(function( index ) { + paragraphsTxt+="

" + jQuery(this).html() + "

"; + console.log(jQuery(this).html()) + foundCommentableParagraph = true; + }); + + if(foundCommentableParagraph === true){ + tinyMCE.activeEditor.setContent(paragraphsTxt) + return; + } + jQuery('#article_body_ifr').contents().find('body').children('p').each(function( index ) { - paragraphsTxt+='

' + jQuery(this).html() + '

' + paragraphsTxt+='

' + jQuery(this).html() + '


' }); tinyMCE.activeEditor.setContent(paragraphsTxt) } -- libgit2 0.21.2