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

Eliminate "Hide current user" checkbox.

This was only useful for moderators before all the comments of
moderators were automatically marked as read.
parent 1c222f90
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ Ext.define("Docs.Settings", {
        },
        comments: {
            hideRead: false,
            hideCurrentUser: false,
            sortByScore: false
        },
        showPrivateClasses: false,
+0 −1
Original line number Diff line number Diff line
@@ -296,7 +296,6 @@ Ext.define('Docs.controller.Comments', {
            offset: offset || 0,
            limit: 100,
            hideRead: settings.hideRead ? 1 : undefined,
            hideCurrentUser: settings.hideCurrentUser ? 1 : undefined,
            sortByScore: settings.sortByScore ? 1 : undefined,
            username: this.recentCommentsSettings.username
        };
+15 −19
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@ Ext.define('Docs.view.comments.List', {
                '<h1 style="float:left;">Comments</h1>',
                '<p style="float:left; margin: 5px 0 0 25px">',
                '<label style="padding-right: 10px;"><input type="checkbox" name="hideRead" id="hideRead" /> Hide read</label>',
                '<label><input type="checkbox" name="hideCurrentUser" id="hideCurrentUser" /> Hide current User</label>',
                '</p>'
            ].join(" ")
        }
@@ -68,26 +67,23 @@ Ext.define('Docs.view.comments.List', {
        }
    },

    // Initializes all checkboxes from settings.
    // Bind event handlers to fire changeSetting event when checked/unchecked.
    // Initializes the hideRead checkbox from settings.
    initCheckboxes: function() {
        var settings = Docs.Settings.get("comments");
        Ext.Array.forEach(['hideRead', 'hideCurrentUser'], function(id) {
            var cb = Ext.get(id);
        var cb = Ext.get('hideRead');
        if (cb) {
                cb.dom.checked = settings[id];
            cb.dom.checked = settings.hideRead;
            cb.on("change", function() {
                    this.saveSetting(id, cb.dom.checked);
                this.saveSetting('hideRead', cb.dom.checked);
                /**
                 * @event settingChange
                 * Fired when one of the comments settings checkboxes is checked/unchecked.
                 * @param {String} name The name of the setting
                 * @param {Boolean} enabled True if setting is turned on, false when off.
                 */
                    this.fireEvent("settingChange", id, cb.dom.checked);
                this.fireEvent("settingChange", 'hideRead', cb.dom.checked);
            }, this);
        }
        }, this);

        // Hide the hideRead checkbox if user is not moderator
        this.setHideReadVisibility();