From 8303c08437b9b60078c588ff41a7fe432405b705 Mon Sep 17 00:00:00 2001 From: rr- Date: Sat, 11 Jun 2016 11:00:52 +0200 Subject: [PATCH] client/users: make avatars clickable --- client/css/main.styl | 1 - client/js/util/views.js | 11 +++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/client/css/main.styl b/client/css/main.styl index 07aa31ad..af7dff9e 100644 --- a/client/css/main.styl +++ b/client/css/main.styl @@ -171,7 +171,6 @@ a .access-key opacity: 0 width: 100% height: 100% -span>.thumbnail width: 20px height: 20px margin: 0 0.4em 0 0.4em diff --git a/client/js/util/views.js b/client/js/util/views.js index 370322f5..940d035a 100644 --- a/client/js/util/views.js +++ b/client/js/util/views.js @@ -161,12 +161,11 @@ function makeTagLink(name) { } function makeUserLink(user) { - let link = api.hasPrivilege('users:view') ? - makeNonVoidElement('a', {'href': '/user/' + user.name}, user.name) : - user.name; - return makeNonVoidElement('span', {class: 'user'}, - makeThumbnail(user.avatarUrl) + - link); + const text = makeThumbnail(user.avatarUrl) + user.name; + const link = api.hasPrivilege('users:view') ? + makeNonVoidElement('a', {'href': '/user/' + user.name}, text) : + text; + return makeNonVoidElement('span', {class: 'user'}, link); } function makeFlexboxAlign(options) {