Commit f8b5cea9 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Fix JS error when recent comments list is empty.

parent ef3e7dcd
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -691,9 +691,10 @@ Ext.define('Docs.controller.Comments', {

    updateCommentsPager: function(comments, data) {
        var last = data[data.length - 1] || {};
        comments.down('.recent-comments-pager').update(
            Docs.view.Comments.getPagerHtml(last)
        );
        var pager = comments.down('.recent-comments-pager');
        if (pager) {
            pager.update(Docs.view.Comments.getPagerHtml(last));
        }
    },

    toggleNewComment: function(cmp, el) {
+1 −1
Original line number Diff line number Diff line
@@ -294,7 +294,7 @@ Ext.define('Docs.view.Comments', {
     * @param {Number} opts.total_rows
     */
    getPagerHtml: function(opts) {
        var total = opts.total_rows;
        var total = opts.total_rows || 0;
        var loaded = opts.offset + opts.limit;
        var next_load = Math.min(opts.limit, total - loaded);