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() { pandora.ui.userButton = function() {
var isGuest = pandora.user.level == 'guest', 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>') $('<div>')
.addClass('OxLight') .addClass('OxLight')
@ -13,7 +27,7 @@ pandora.ui.userButton = function() {
fontSize: '9px' fontSize: '9px'
}) })
.html( .html(
isGuest ? 'not signed in' isGuest ? Ox._('not signed in')
: Ox.encodeHTMLEntities(pandora.user.username) : Ox.encodeHTMLEntities(pandora.user.username)
) )
.appendTo(that); .appendTo(that);
@ -21,23 +35,9 @@ pandora.ui.userButton = function() {
Ox.Button({ Ox.Button({
style: 'symbol', style: 'symbol',
title: 'user', 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' type: 'image'
}) })
.css({ .css({float: 'left'})
float: 'left'
})
.bindEvent({
singleclick: function() {
pandora.UI.set({page: isGuest ? 'signup' : 'preferences'});
},
doubleclick: function() {
pandora.UI.set({page: isGuest ? 'signin' : 'signout'});
}
})
.appendTo(that); .appendTo(that);
return that; return that;