Permalink
Browse files

bugfix

  • Loading branch information...
nibsirahsieu committed Apr 3, 2011
1 parent 2411783 commit 59f24915ec8d50051299e18ce80c968d37633c13
@@ -86,8 +86,8 @@ public function executeAddComment(sfWebRequest $request)
public function executeCommenting(sfWebRequest $request)
{
$this->forward404Unless($request->isXmlHttpRequest());
- $commentableObject = sfNestedCommentTools::getCommentableObject($request->getParameter('commentable_model'), $request->getParameter('commentable_id'));
+ $commentableObject = PropelQuery::from($request->getParameter('commentable_model'))->findPk($request->getParameter('commentable_id'));
$comments = sfNestedCommentTools::getComments($commentableObject, $request);
return $this->renderPartial('sfNestedComment/comment_list', array('comments' => $comments));
}
-}
+}
@@ -23,6 +23,17 @@
<?php $model = get_class($object) ?>
<?php endif; ?>
<script type="text/javascript">
+ function collapsibleComments()
+ {
+ <?php if($enable_nested): ?>
+ jQuery('#commentlist').collapsible({
+ imagehide: '<?php echo image_path('/sfNestedCommentPlugin/images/arrow-down.png') ?>',
+ imageshow: '<?php echo image_path('/sfNestedCommentPlugin/images/arrow-right.png') ?>',
+ defaulthide: false
+ });
+ <?php endif; ?>
+ };
+
jQuery(document).ready(function() {
jQuery('a.comment-link').live('click', function(event) {
var comment_list = jQuery('#sfNestedComment_comment_list');
@@ -33,16 +44,11 @@
}, function(response){
comment_list.html(response);
comment_list.show();
+ collapsibleComments();
});
return false;
});
- <?php if($enable_nested): ?>
- jQuery('#commentlist').collapsible({
- imagehide: '<?php echo image_path('/sfNestedCommentPlugin/images/arrow-down.png') ?>',
- imageshow: '<?php echo image_path('/sfNestedCommentPlugin/images/arrow-right.png') ?>',
- defaulthide: false
- });
- <?php endif; ?>
+ collapsibleComments();
});
</script>
-<?php endif; ?>
+<?php endif; ?>

0 comments on commit 59f2491

Please sign in to comment.