From d8fff463defd937a60fb9d66a0279c352470efdb Mon Sep 17 00:00:00 2001 From: rolux Date: Sat, 14 Sep 2013 09:24:27 +0200 Subject: [PATCH] fix #1851 (user menu extra: text should be clickable too) --- static/js/userButton.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) 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;