Loading template/app/Comments.js +32 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,38 @@ Ext.define('Docs.Comments', { }); }, /** * Loads subscription data for current user. * Called after logging in. * @param {Function} callback Called after done. * @param {Object} scope */ loadSubscriptions: function(callback, scope) { this.fetchSubscriptions(function(subscriptions) { this.subscriptions = new Docs.CommentSubscriptions(subscriptions); callback.call(scope); }, this); }, /** * Clears the data about all subcsriptions. * Called after logging out. */ clearSubscriptions: function() { this.subscriptions = new Docs.CommentSubscriptions([]); }, fetchSubscriptions: function(callback, scope) { this.request("jsonp", { url: '/subscriptions', method: 'GET', success: function(response) { callback.call(scope, response.subscriptions); }, scope: this }); }, /** * True when comments system is enabled. * @return {Boolean} Loading template/app/controller/Auth.js +12 −8 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ Ext.define('Docs.controller.Auth', { }, setLoggedIn: function() { Docs.Comments.loadSubscriptions(function() { this.getAuthHeaderForm().showLoggedIn(Docs.Auth.getUser()); this.eachCmp("commentsListWithForm", function(list) { list.showCommentingForm(); Loading @@ -71,9 +72,12 @@ Ext.define('Docs.controller.Auth', { list.refresh(); }); this.getController("Tabs").showCommentsTab(); }, this); }, setLoggedOut: function() { Docs.Comments.clearSubscriptions(); this.getAuthHeaderForm().showLoggedOut(); this.eachCmp("commentsListWithForm", function(list) { list.showAuthForm(); Loading Loading
template/app/Comments.js +32 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,38 @@ Ext.define('Docs.Comments', { }); }, /** * Loads subscription data for current user. * Called after logging in. * @param {Function} callback Called after done. * @param {Object} scope */ loadSubscriptions: function(callback, scope) { this.fetchSubscriptions(function(subscriptions) { this.subscriptions = new Docs.CommentSubscriptions(subscriptions); callback.call(scope); }, this); }, /** * Clears the data about all subcsriptions. * Called after logging out. */ clearSubscriptions: function() { this.subscriptions = new Docs.CommentSubscriptions([]); }, fetchSubscriptions: function(callback, scope) { this.request("jsonp", { url: '/subscriptions', method: 'GET', success: function(response) { callback.call(scope, response.subscriptions); }, scope: this }); }, /** * True when comments system is enabled. * @return {Boolean} Loading
template/app/controller/Auth.js +12 −8 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ Ext.define('Docs.controller.Auth', { }, setLoggedIn: function() { Docs.Comments.loadSubscriptions(function() { this.getAuthHeaderForm().showLoggedIn(Docs.Auth.getUser()); this.eachCmp("commentsListWithForm", function(list) { list.showCommentingForm(); Loading @@ -71,9 +72,12 @@ Ext.define('Docs.controller.Auth', { list.refresh(); }); this.getController("Tabs").showCommentsTab(); }, this); }, setLoggedOut: function() { Docs.Comments.clearSubscriptions(); this.getAuthHeaderForm().showLoggedOut(); this.eachCmp("commentsListWithForm", function(list) { list.showAuthForm(); Loading