diff --git a/static/js/userButton.js b/static/js/userButton.js
index 2192cbb6..a0709d64 100644
--- a/static/js/userButton.js
+++ b/static/js/userButton.js
@@ -3,7 +3,21 @@
pandora.ui.userButton = function() {
var isGuest = pandora.user.level == 'guest',
- that = Ox.Element().css({marginLeft: '3px'});
+ that = Ox.Element({
+ tooltip: Ox._(
+ isGuest ? 'Click to sign up or doubleclick to sign in'
+ : 'Click to open preferences or doubleclick to sign out'
+ )
+ })
+ .css({marginLeft: '3px'})
+ .bindEvent({
+ singleclick: function() {
+ pandora.UI.set({page: isGuest ? 'signup' : 'preferences'});
+ },
+ doubleclick: function() {
+ pandora.UI.set({page: isGuest ? 'signin' : 'signout'});
+ }
+ });
$('
')
.addClass('OxLight')
@@ -13,7 +27,7 @@ pandora.ui.userButton = function() {
fontSize: '9px'
})
.html(
- isGuest ? 'not signed in'
+ isGuest ? Ox._('not signed in')
: Ox.encodeHTMLEntities(pandora.user.username)
)
.appendTo(that);
@@ -21,23 +35,9 @@ pandora.ui.userButton = function() {
Ox.Button({
style: 'symbol',
title: 'user',
- tooltip: Ox._(
- isGuest ? 'Click to sign up or doubleclick to sign in'
- : 'Click to open preferences or doubleclick to sign out'
- ),
type: 'image'
})
- .css({
- float: 'left'
- })
- .bindEvent({
- singleclick: function() {
- pandora.UI.set({page: isGuest ? 'signup' : 'preferences'});
- },
- doubleclick: function() {
- pandora.UI.set({page: isGuest ? 'signin' : 'signout'});
- }
- })
+ .css({float: 'left'})
.appendTo(that);
return that;