From f33ebc512bdfa86437cb1f36bbaf4195bac69437 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 24 Jul 2014 13:13:24 -0400 Subject: [PATCH] FIX: Link a poster's name to their profile, makes much more sense now that we're showing the popup to that. --- .../discourse/components/poster-name.js.es6 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/discourse/components/poster-name.js.es6 b/app/assets/javascripts/discourse/components/poster-name.js.es6 index 3817b2d33d6..4cb479bae9c 100644 --- a/app/assets/javascripts/discourse/components/poster-name.js.es6 +++ b/app/assets/javascripts/discourse/components/poster-name.js.es6 @@ -14,7 +14,8 @@ var PosterNameComponent = Em.Component.extend({ var name = post.get('name'), username = post.get('username'), linkClass = 'username', - primaryGroupName = post.get('primary_group_name'); + primaryGroupName = post.get('primary_group_name'), + url = post.get('usernameUrl'); if (post.get('staff')) { linkClass += ' staff'; } if (post.get('admin')) { linkClass += ' admin'; } @@ -25,7 +26,7 @@ var PosterNameComponent = Em.Component.extend({ linkClass += ' ' + primaryGroupName; } // Main link - buffer.push("" + username + ""); + buffer.push("" + username + ""); // Add a glyph if we have one var glyph = this.posterGlyph(post); @@ -37,7 +38,7 @@ var PosterNameComponent = Em.Component.extend({ // Are we showing full names? if (name && this.get('displayNameOnPosts') && (this.sanitizeName(name) !== this.sanitizeName(username))) { name = Handlebars.Utils.escapeExpression(name); - buffer.push("" + name + ""); + buffer.push("" + name + ""); } // User titles @@ -60,9 +61,10 @@ var PosterNameComponent = Em.Component.extend({ click: function(e) { var $target = $(e.target), - href = $target.attr('href'); + href = $target.attr('href'), + url = this.get('post.usernameUrl'); - if (!Em.isEmpty(href) && href !== '#') { + if (!Em.isEmpty(href) && href !== url) { return true; } else { this.appEvents.trigger('poster:expand', $target);