From 5d66f6ed8ee64ba4fad490f3aedf15afbe34df29 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Fri, 26 Jul 2013 15:56:29 -0400 Subject: [PATCH] Minor fixes. Link directoy to user activity to avoid a redirect. --- app/assets/javascripts/discourse.js | 3 --- app/assets/javascripts/discourse/models/user.js | 1 + app/assets/javascripts/discourse/models/user_stream.js | 6 +++--- .../javascripts/discourse/templates/header.js.handlebars | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/discourse.js b/app/assets/javascripts/discourse.js index f4234a441f0..603780a4a1a 100644 --- a/app/assets/javascripts/discourse.js +++ b/app/assets/javascripts/discourse.js @@ -13,9 +13,6 @@ Discourse = Ember.Application.createWithMixins(Discourse.Ajax, { // Whether the app has focus or not hasFocus: true, - // Are we currently scrolling? - scrolling: false, - // Helps with integration tests URL_FIXTURES: {}, diff --git a/app/assets/javascripts/discourse/models/user.js b/app/assets/javascripts/discourse/models/user.js index a21ffeb93c9..cf1a9e72b20 100644 --- a/app/assets/javascripts/discourse/models/user.js +++ b/app/assets/javascripts/discourse/models/user.js @@ -249,6 +249,7 @@ Discourse.User = Discourse.Model.extend({ findDetails: function() { var user = this; + return PreloadStore.getAndRemove("user_" + user.get('username'), function() { return Discourse.ajax("/users/" + user.get('username') + '.json'); }).then(function (json) { diff --git a/app/assets/javascripts/discourse/models/user_stream.js b/app/assets/javascripts/discourse/models/user_stream.js index 3a15cece1c5..0b9edfe4195 100644 --- a/app/assets/javascripts/discourse/models/user_stream.js +++ b/app/assets/javascripts/discourse/models/user_stream.js @@ -17,7 +17,7 @@ Discourse.UserStream = Discourse.Model.extend({ }.observes('filter'), findItems: function() { - var me = this; + var userStream = this; if(this.get("loading")) { return Ember.RSVP.reject(); } this.set("loading",true); @@ -28,7 +28,7 @@ Discourse.UserStream = Discourse.Model.extend({ var stream = this; return Discourse.ajax(url, {cache: 'false'}).then( function(result) { - me.set("loading",false); + userStream.set("loading",false); if (result && result.user_actions) { var copy = Em.A(); _.each(result.user_actions,function(action) { @@ -38,7 +38,7 @@ Discourse.UserStream = Discourse.Model.extend({ stream.get('content').pushObjects(copy); stream.set('itemsLoaded', stream.get('itemsLoaded') + result.user_actions.length); } - }, function(){ me.set("loading", false); }); + }, function(){ userStream.set("loading", false); }); } }); diff --git a/app/assets/javascripts/discourse/templates/header.js.handlebars b/app/assets/javascripts/discourse/templates/header.js.handlebars index 3d3d04e0663..d1784efaa39 100644 --- a/app/assets/javascripts/discourse/templates/header.js.handlebars +++ b/app/assets/javascripts/discourse/templates/header.js.handlebars @@ -85,7 +85,7 @@
  • {{#if currentUser}} - {{#titledLinkTo 'user' currentUser titleKey="current_user" class="icon"}}{{avatar currentUser imageSize="medium" }}{{/titledLinkTo}} + {{#linkTo 'userActivity.index' currentUser titleKey="current_user" class="icon"}}{{avatar currentUser imageSize="medium" }}{{/linkTo}} {{else}}
    {{/if}}