fix #1851 (user menu extra: text should be clickable too)

This commit is contained in:
rolux 2013-09-14 09:24:27 +02:00
parent 9732d329b5
commit d8fff463de

View file

@ -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'});
}
});
$('<div>')
.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;