fixing user label when viewing with js disabled

v1.18.x
Julian Lam 12 years ago
parent 05b91caf6c
commit 07d4466cb4

@ -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 = '<a href="/users/' + data['username'] + '">' +
'<img src="' + data['picture'] + '?s=24&default=identicon" />' +
'<span>' + data['username'] + '</span>' +
'</a>';
logoutEl.innerHTML = '<a href="/logout">Log out</a>';
rightMenu[0].appendChild(userLabel);
rightMenu[0].appendChild(logoutEl);
} else {
rightMenu.html('');
var registerEl = document.createElement('li'),

@ -66,16 +66,6 @@
<li><a href="#"><i class="icon-refresh icon-spin"></i> Loading Notifications</a></li>
</ul>
</li>
<li>
<a id="user_label" href="">
<img src=""/>
<span></span>
</a>
</li>
<li>
<a href="/logout">Log out</a>
</li>
</ul>
</div>
</div>

Loading…
Cancel
Save