From 3e34183a979cf2e3b46b250c38e9bd23b1e2b75a Mon Sep 17 00:00:00 2001 From: Dongsheng Cai Date: Thu, 18 Mar 2010 09:57:32 +0000 Subject: [PATCH] "MDL-19118, improve comments pagination" --- comment/comment.js | 2 +- comment/lib.php | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/comment/comment.js b/comment/comment.js index af47c769fe9..fc36c49c999 100644 --- a/comment/comment.js +++ b/comment/comment.js @@ -265,7 +265,7 @@ M.core_comment = { register_pagination: function() { var scope = this; // page buttons - Y.all('#comment-paging-'+this.client_id+' a').each( + Y.all('#comment-pagination-'+this.client_id+' a').each( function(node, id) { node.on('click', function(e, node) { var id = node.get('id'); diff --git a/comment/lib.php b/comment/lib.php index 7ef2c309b92..528a460d544 100644 --- a/comment/lib.php +++ b/comment/lib.php @@ -313,12 +313,14 @@ EOD; // in comments block, we print comments list right away if ($this->env == 'block_comments') { $html .= $this->print_comments(0, true, false); - } - - $html .= <<get_pagination(0); + } else { + $html .= <<
EOD; + } // print posting textarea if (!empty($this->postcap)) { @@ -369,7 +371,7 @@ EOD; if (empty($this->viewcap)) { return false; } - $CFG->commentsperpage = 3; + $CFG->commentsperpage = 15; if (!is_numeric($page)) { $page = 0; } @@ -435,7 +437,7 @@ EOD; } else { // return ajax paging bar $str = ''; - $str .= '
'; + $str .= '
'; for ($p=0; $p<$pages; $p++) { $extra = ''; if ($p == $page) { @@ -551,8 +553,8 @@ EOD; if ($nonjs) { $html .= ''; + $html .= $this->get_pagination($page); } - $html .= $this->get_pagination($page); $sesskey = sesskey(); $returnurl = qualified_me(); $strsubmit = get_string('submit');