Commit 9c0f40c0 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Update comment counts also in guide/video pages.

parent 05f30593
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -10,8 +10,16 @@ Ext.define('Docs.controller.CommentCounts', {

    refs: [
        {
            ref: "classOverview",
            ref: "class",
            selector: "classoverview"
        },
        {
            ref: 'guide',
            selector: '#guide'
        },
        {
            ref: 'video',
            selector: '#video'
        }
    ],

@@ -20,7 +28,9 @@ Ext.define('Docs.controller.CommentCounts', {
    },

    updateCounts: function(target, count) {
        this.getClassOverview().updateCommentCounts();
        this.getClass().updateCommentCounts();
        this.getGuide().updateCommentCounts();
        this.getVideo().updateCommentCounts();
    }

});
+11 −1
Original line number Diff line number Diff line
@@ -60,10 +60,20 @@ Ext.define('Docs.view.guides.Container', {
    },

    initComments: function() {
        new Docs.view.comments.LargeExpander({
        this.expander = new Docs.view.comments.LargeExpander({
            type: "guide",
            name: this.guide.name,
            el: this.getEl().down(".x-panel-body")
        });
    },

    /**
     * Updates the comments counter.
     */
    updateCommentCounts: function() {
        if (!this.expander) {
            return;
        }
        this.expander.getExpander().setCount(Docs.Comments.getCount(["guide", this.guide.name, ""]));
    }
});
+11 −1
Original line number Diff line number Diff line
@@ -59,10 +59,20 @@ Ext.define('Docs.view.videos.Container', {
    },

    initComments: function() {
        new Docs.view.comments.LargeExpander({
        this.expander = new Docs.view.comments.LargeExpander({
            type: "video",
            name: this.video.name,
            el: this.getEl().down(".x-panel-body")
        });
    },

    /**
     * Updates the comments counter.
     */
    updateCommentCounts: function() {
        if (!this.expander) {
            return;
        }
        this.expander.getExpander().setCount(Docs.Comments.getCount(["video", this.video.name, ""]));
    }
});
 No newline at end of file