move avatar into clickable area of user menu

This commit is contained in:
Jan-Christoph Borchardt 2014-02-20 13:36:52 +01:00
parent 3e2c56157b
commit 92d57cb5a7
3 changed files with 10 additions and 8 deletions

View File

@ -37,11 +37,12 @@ body { background:#fefefe; font:normal .8em/1.6em "Helvetica Neue",Helvetica,Ari
.header-right { float:right; vertical-align:middle; padding:0.5em; } .header-right { float:right; vertical-align:middle; padding:0.5em; }
.header-right > * { vertical-align:middle; } .header-right > * { vertical-align:middle; }
/* Profile picture in header */
#header .avatardiv { #header .avatardiv {
float: left; float: left;
display: inline-block; display: inline-block;
margin-right: 5px;
} }
#header .avatardiv img { #header .avatardiv img {
opacity: 1; opacity: 1;
} }
@ -708,12 +709,11 @@ label.infield { cursor:text !important; top:1.05em; left:.85em; }
/* USER MENU */ /* USER MENU */
#settings { #settings {
float: right; float: right;
margin-top: 7px;
margin-left: 10px;
color: #bbb; color: #bbb;
} }
#expand { #expand {
padding: 15px 15px 15px 5px; display: block;
padding: 7px 12px 6px 7px;
cursor: pointer; cursor: pointer;
font-weight: bold; font-weight: bold;
} }

View File

@ -860,6 +860,7 @@ function initCore() {
// checkShowCredentials(); // checkShowCredentials();
// $('input#user, input#password').keyup(checkShowCredentials); // $('input#user, input#password').keyup(checkShowCredentials);
// user menu
$('#settings #expand').keydown(function(event) { $('#settings #expand').keydown(function(event) {
if (event.which === 13 || event.which === 32) { if (event.which === 13 || event.which === 32) {
$('#expand').click() $('#expand').click()
@ -872,7 +873,8 @@ function initCore() {
$('#settings #expanddiv').click(function(event){ $('#settings #expanddiv').click(function(event){
event.stopPropagation(); event.stopPropagation();
}); });
$(document).click(function(){//hide the settings menu when clicking outside it //hide the user menu when clicking outside it
$(document).click(function(){
$('#settings #expanddiv').slideUp(200); $('#settings #expanddiv').slideUp(200);
}); });

View File

@ -50,12 +50,12 @@
<div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div> <div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div>
<div id="settings" class="svg"> <div id="settings" class="svg">
<span id="expand" tabindex="0" role="link"> <span id="expand" tabindex="0" role="link">
<?php if ($_['enableAvatars']): ?>
<div class="avatardiv"></div>
<?php endif; ?>
<span id="expandDisplayName"><?php p(trim($_['user_displayname']) != '' ? $_['user_displayname'] : $_['user_uid']) ?></span> <span id="expandDisplayName"><?php p(trim($_['user_displayname']) != '' ? $_['user_displayname'] : $_['user_uid']) ?></span>
<img class="svg" alt="" src="<?php print_unescaped(image_path('', 'actions/caret.svg')); ?>" /> <img class="svg" alt="" src="<?php print_unescaped(image_path('', 'actions/caret.svg')); ?>" />
</span> </span>
<?php if ($_['enableAvatars']): ?>
<div class="avatardiv"></div>
<?php endif; ?>
<div id="expanddiv"> <div id="expanddiv">
<ul> <ul>
<?php foreach($_['settingsnavigation'] as $entry):?> <?php foreach($_['settingsnavigation'] as $entry):?>