hopefully finally fix #946

This commit is contained in:
MrZYX 2011-04-11 19:01:16 +02:00
parent e91c153257
commit 440fd26c14
3 changed files with 31 additions and 26 deletions

View file

@ -34,11 +34,12 @@
= @unread_message_count = @unread_message_count
%ul#user_menu %ul#user_menu
.right %li
▼ .right
.avatar ▼
= owner_image_tag(:thumb_small) .avatar
= link_to current_user.name, '#' = owner_image_tag(:thumb_small)
= link_to current_user.name, '#'
%li= link_to t('.profile'), current_user.person %li= link_to t('.profile'), current_user.person
%li= link_to t('.settings'), edit_user_path %li= link_to t('.settings'), edit_user_path
%li= link_to t('.logout'), destroy_user_session_path %li= link_to t('.logout'), destroy_user_session_path

View file

@ -223,18 +223,16 @@ var View = {
userMenu: { userMenu: {
click: function(evt) { click: function(evt) {
if(!$(View.userMenu.selector).hasClass("active")) { $(this).parent().toggleClass("active");
evt.preventDefault(); evt.preventDefault();
}
$(this).toggleClass("active");
}, },
removeFocus: function(evt) { removeFocus: function(evt) {
var $target = $(evt.target); var $target = $(evt.target);
if(!$target.closest("#user_menu").length) { if(!$target.closest("#user_menu").length || ($target.attr('href') != undefined && $target.attr('href') != '#')) {
$(View.userMenu.selector).removeClass("active"); $(View.userMenu.selector).parent().removeClass("active");
} }
}, },
selector: "#user_menu" selector: "#user_menu li:first-child"
}, },
webFingerForm: { webFingerForm: {

View file

@ -178,16 +178,6 @@ header
:top 5px :top 5px
:right 0 :right 0
a
:padding
:right 15px
:color #CCC
&:hover
:text
:decoration none
.right
:right 5px
&:hover &:hover
:background :background
:color #222 :color #222
@ -199,10 +189,26 @@ header
:display block :display block
:padding 4px :padding 4px
:height 100% :height 100%
&:hover &:hover
:background :background
:color $blue :color $blue
:color #fff :color #fff
&:first-child
:display inline
a
:height auto
:display inline
:padding
:right 15px
:color #CCC
&:hover
:background
:color #222
:text
:decoration none
.right
:right 5px
&.active &.active
@include box-shadow(0,1px,2px,#333) @include box-shadow(0,1px,2px,#333)