reshare dropdown looks nicer. fixed user menu to drop down on click

This commit is contained in:
danielvincent 2010-10-19 16:16:46 -07:00
parent 3557d66749
commit f6303b8fff
4 changed files with 41 additions and 22 deletions

View file

@ -2,16 +2,6 @@
-# licensed under the Affero General Public License version 3 or later. See -# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file. -# the COPYRIGHT file.
:javascript
$(".reshare_button").toggle(function(e){
e.preventDefault();
$(this).parent(".reshare_pane").children(".reshare_box").fadeIn(200);
}, function(e) {
e.preventDefault();
$(this).parent(".reshare_pane").children(".reshare_box").fadeOut(200);
});
- unless current_user.aspects.size == current_user.aspects_with_post(post.id).size - unless current_user.aspects.size == current_user.aspects_with_post(post.id).size
.reshare_pane .reshare_pane
%span.reshare_button %span.reshare_button

View file

@ -29,7 +29,7 @@ $(".show_post_comments").live('click', function(event) {
$(this).toggleClass( "visible" ); $(this).toggleClass( "visible" );
}); });
$(".comment_box").live('focus', function(evt){ $(".comment_box").toggle(function(evt){
var $this = $(this); var $this = $(this);
$this.attr("rows", 2); $this.attr("rows", 2);
$this.parents("p").parents("form").children("p").children(".comment_submit").fadeIn(200); $this.parents("p").parents("form").children("p").children(".comment_submit").fadeIn(200);
@ -47,3 +47,9 @@ $(".comment_submit").live('click', function(evt){
$(this).closest("form").children("p .comment_box").attr("rows", 1); $(this).closest("form").children("p .comment_box").attr("rows", 1);
}); });
$(".reshare_button").live("click", function(e){
e.preventDefault();
$(this).parent(".reshare_pane").children(".reshare_box").show();
$(this).addClass("active");
});

View file

@ -53,6 +53,21 @@ $(document).ready(function(){
} }
}); });
$("#user_menu").click( function(){
$(this).toggleClass("active");
});
$('body').click( function(event){
if(!$(event.target).closest('#user_menu').length){
$("#user_menu").removeClass("active");
};
if(!$(event.target).closest('.reshare_box').length){
$(".reshare_button").removeClass("active");
$(".reshare_box").hide();
};
});
});//end document ready });//end document ready

View file

@ -128,9 +128,9 @@ header
a a
:text-shadow 0 1px 0 #000 :text-shadow 0 1px 0 #000
:width 100px
:z-index 10 :z-index 10
:font
:size 14px
:padding 5px 10px :padding 5px 10px
:left 40px :left 40px
:margin 0 :margin 0
@ -152,11 +152,7 @@ header
a a
:display block :display block
&:hover &.active
li
:display block
&:hover
:margin :margin
:top -3px :top -3px
:right -6px :right -6px
@ -168,6 +164,9 @@ header
:-webkit-box-shadow 0 1px 2px #333 :-webkit-box-shadow 0 1px 2px #333
:-moz-box-shadow 0 1px 2px #333 :-moz-box-shadow 0 1px 2px #333
li
:display block
.avatar .avatar
:height 20px :height 20px
:width 20px :width 20px
@ -294,6 +293,16 @@ li.message
:decoration none :decoration none
:cursor default :cursor default
.right .reshare_pane .reshare_button
:padding 5px
&.active
:background
:color #333
:border-radius 5px 5px 0 0
a
:color #fff
:text-shadow none
.right .reshare_pane .right .reshare_pane
:margin :margin
:left 5px :left 5px
@ -301,13 +310,14 @@ li.message
:display inline :display inline
:position relative :position relative
ul.reshare_box ul.reshare_box
:width 150px :width 150px
:display none :display none
:z-index 10 :z-index 10
:position absolute :position absolute
:margin :margin
:top 5px :top 0
:padding 0 :padding 0
:background :background
@ -316,9 +326,7 @@ li.message
:list :list
:style none :style none
:border 5px solid #666 :border 5px solid #333
:-webkit-box-shadow 0 0 5px #666
:-moz-box-shadow 0 0 5px #666
:text-shadow 0 2px #fff :text-shadow 0 2px #fff
:color #000 :color #000