From 07d4466cb45d829c58dd4e2f76a790016a50ce34 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 14 Jun 2013 13:34:14 -0400 Subject: [PATCH] fixing user label when viewing with js disabled --- public/src/forum/footer.js | 16 ++++++++++------ public/templates/header.tpl | 10 ---------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/public/src/forum/footer.js b/public/src/forum/footer.js index 1273e29d4b..bc55f2322f 100644 --- a/public/src/forum/footer.js +++ b/public/src/forum/footer.js @@ -35,14 +35,18 @@ socket.on('api:updateHeader', function(data) { var rightMenu = $('#right-menu'); if (data.uid > 0) { - var userLabel = rightMenu.find('#user_label'); - userLabel.attr('href','/users/'+data['username']); + var userLabel = document.createElement('li'), + logoutEl = document.createElement('li'); - userLabel.find('img').attr('src',data['picture']+"?s=24&default=identicon"); - userLabel.find('span').html(data['username']); - + userLabel.innerHTML = '' + + '' + + '' + data['username'] + '' + + ''; + logoutEl.innerHTML = 'Log out'; + + rightMenu[0].appendChild(userLabel); + rightMenu[0].appendChild(logoutEl); } else { - rightMenu.html(''); var registerEl = document.createElement('li'), diff --git a/public/templates/header.tpl b/public/templates/header.tpl index abec0712ff..a01e674241 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -66,16 +66,6 @@
  • Loading Notifications
  • -
  • - - - - -
  • -
  • - Log out -
  • -