Loading template/app/Settings.js +1 −2 Original line number Diff line number Diff line Loading @@ -19,8 +19,7 @@ Ext.define("Docs.Settings", { "accessor": true }, comments: { hideRead: false, sortByScore: false hideRead: false }, showPrivateClasses: false, classTreeLogic: "PackageLogic" Loading template/app/controller/Comments.js +6 −2 Original line number Diff line number Diff line Loading @@ -143,7 +143,11 @@ Ext.define('Docs.controller.Comments', { }, 'commentsList': { settingChange: function() { hideReadChange: function() { this.fetchRecentComments(); }, sortOrderChange: function(orderBy) { this.recentCommentsSettings.sortByScore = (orderBy === "recent"); this.fetchRecentComments(); } }, Loading Loading @@ -303,7 +307,7 @@ Ext.define('Docs.controller.Comments', { offset: offset || 0, limit: 100, hideRead: settings.hideRead ? 1 : undefined, sortByScore: settings.sortByScore ? 1 : undefined, sortByScore: this.recentCommentsSettings.sortByScore ? 1 : undefined, username: this.recentCommentsSettings.username, targetId: this.recentCommentsSettings.targetId }; Loading template/app/view/comments/List.js +14 −11 Original line number Diff line number Diff line Loading @@ -47,6 +47,17 @@ Ext.define('Docs.view.comments.List', { } ], /** * @event hideReadChange * Fired when the hideRead checkbox is checked/unchecked. */ /** * @event sortOrderChange * Fired when the tab is switched. * @param {String} sortBy Either "recent" or "votes". */ afterRender: function() { this.callParent(arguments); Loading Loading @@ -75,13 +86,7 @@ Ext.define('Docs.view.comments.List', { cb.dom.checked = settings.hideRead; cb.on("change", function() { 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", 'hideRead', cb.dom.checked); this.fireEvent("hideReadChange"); }, this); } Loading @@ -105,12 +110,10 @@ Ext.define('Docs.view.comments.List', { this.down("tabpanel[cls=comments-tabpanel]").on("tabchange", function(panel, newTab) { if (newTab.title === "Recent") { this.saveSetting("sortByScore", false); this.fireEvent("settingChange", "sortByScore", false); this.fireEvent("sortOrderChange", "recent"); } else { this.saveSetting("sortByScore", true); this.fireEvent("settingChange", "sortByScore", true); this.fireEvent("sortOrderChange", "votes"); } }, this); }, Loading Loading
template/app/Settings.js +1 −2 Original line number Diff line number Diff line Loading @@ -19,8 +19,7 @@ Ext.define("Docs.Settings", { "accessor": true }, comments: { hideRead: false, sortByScore: false hideRead: false }, showPrivateClasses: false, classTreeLogic: "PackageLogic" Loading
template/app/controller/Comments.js +6 −2 Original line number Diff line number Diff line Loading @@ -143,7 +143,11 @@ Ext.define('Docs.controller.Comments', { }, 'commentsList': { settingChange: function() { hideReadChange: function() { this.fetchRecentComments(); }, sortOrderChange: function(orderBy) { this.recentCommentsSettings.sortByScore = (orderBy === "recent"); this.fetchRecentComments(); } }, Loading Loading @@ -303,7 +307,7 @@ Ext.define('Docs.controller.Comments', { offset: offset || 0, limit: 100, hideRead: settings.hideRead ? 1 : undefined, sortByScore: settings.sortByScore ? 1 : undefined, sortByScore: this.recentCommentsSettings.sortByScore ? 1 : undefined, username: this.recentCommentsSettings.username, targetId: this.recentCommentsSettings.targetId }; Loading
template/app/view/comments/List.js +14 −11 Original line number Diff line number Diff line Loading @@ -47,6 +47,17 @@ Ext.define('Docs.view.comments.List', { } ], /** * @event hideReadChange * Fired when the hideRead checkbox is checked/unchecked. */ /** * @event sortOrderChange * Fired when the tab is switched. * @param {String} sortBy Either "recent" or "votes". */ afterRender: function() { this.callParent(arguments); Loading Loading @@ -75,13 +86,7 @@ Ext.define('Docs.view.comments.List', { cb.dom.checked = settings.hideRead; cb.on("change", function() { 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", 'hideRead', cb.dom.checked); this.fireEvent("hideReadChange"); }, this); } Loading @@ -105,12 +110,10 @@ Ext.define('Docs.view.comments.List', { this.down("tabpanel[cls=comments-tabpanel]").on("tabchange", function(panel, newTab) { if (newTab.title === "Recent") { this.saveSetting("sortByScore", false); this.fireEvent("settingChange", "sortByScore", false); this.fireEvent("sortOrderChange", "recent"); } else { this.saveSetting("sortByScore", true); this.fireEvent("settingChange", "sortByScore", true); this.fireEvent("sortOrderChange", "votes"); } }, this); }, Loading