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,6 +34,7 @@
= @unread_message_count = @unread_message_count
%ul#user_menu %ul#user_menu
%li
.right .right
▼ ▼
.avatar .avatar

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
@ -204,6 +194,22 @@ header
: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)