Commit 4bffd89b authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Create Docs.Comments class.

With the sole responsibility of providing a way to perform
queries to the comments backend.
parent 776df241
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
/**
 * Provides a way to perform queries to the comments backend.
 */
Ext.define('Docs.Comments', {
    singleton: true,

    /**
     * @inheritdoc Docs.controller.AuthHelpers#request
     */
    request: function(type, config) {
        Docs.App.getController("Comments").request(type, config);
    }

});
+2 −5
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ Ext.define('Docs.view.comments.TopUsers', {
    alias: "widget.topusers",
    extend: 'Ext.panel.Panel',
    componentCls: "top-users",
    requires: ["Docs.Comments"],

    dockedItems: [
        {
@@ -62,7 +63,7 @@ Ext.define('Docs.view.comments.TopUsers', {
    },

    fetchUsers: function(sortBy) {
        this.request("jsonp", {
        Docs.Comments.request("jsonp", {
            url: '/users',
            method: 'GET',
            params: {
@@ -75,10 +76,6 @@ Ext.define('Docs.view.comments.TopUsers', {
        });
    },

    request: function(type, config) {
        Docs.App.getController("Comments").request(type, config);
    },

    renderUsers: function(users) {
        var tpl = new Ext.XTemplate(
            '<ul>',