diff --git a/comment/comment.js b/comment/comment.js index af47c769fe9c9..fc36c49c99969 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 7ef2c309b92d6..528a460d544b5 100644 --- a/comment/lib.php +++ b/comment/lib.php @@ -313,12 +313,14 @@ public function output($return = true) { // 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 @@ public function get_comments($page = '') { if (empty($this->viewcap)) { return false; } - $CFG->commentsperpage = 3; + $CFG->commentsperpage = 15; if (!is_numeric($page)) { $page = 0; } @@ -435,7 +437,7 @@ public function get_pagination($page = 0) { } else { // return ajax paging bar $str = ''; - $str .= '
'; + $str .= '
'; for ($p=0; $p<$pages; $p++) { $extra = ''; if ($p == $page) { @@ -551,8 +553,8 @@ public function print_comments($page = 0, $return = true, $nonjs = true) { if ($nonjs) { $html .= ''; + $html .= $this->get_pagination($page); } - $html .= $this->get_pagination($page); $sesskey = sesskey(); $returnurl = qualified_me(); $strsubmit = get_string('submit');