From e2d8649aaebf06a3092222c59badf86645902f69 Mon Sep 17 00:00:00 2001 From: tanhuazhe Date: Thu, 7 Jan 2016 15:26:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/application.html.haml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 70dc59f..6f397fb 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -24,12 +24,10 @@ %ul.nav.navbar-nav.navbar-right - if is_logined? %li.dropdown - .navbar-header.navbar-avatar - = avatar @current_user - = link_to '#', class: 'dropdown-toggle pull-right', "data-toggle"=>"dropdown" do + = link_to '#',id:'drop', class: 'dropdown-toggle pull-right',"data-toggle"=>"dropdown", "role"=>"button", "aria-haspopup"=>"true" do = @current_user.nickname %span.caret - %ul.dropdown-menu{role: 'menu'} + %ul.dropdown-menu{role: 'menu' ,"aria-labelledby"=>"drop"} %li = link_to '#' do = gravatar_image_tag @current_user.email, size: 100, alt: @current_user.nickname, gravatar: {default: 'https://secure.gravatar.com/avatar/08f077ea061585744ee080824f5a8e65.png?r=PG&d=identicon&s=64'} @@ -40,6 +38,8 @@ = link_to '写博客', new_article_path %li = link_to '退出', logout_path + .navbar-header.navbar-avatar + = avatar @current_user - else %ul.navbar-button.navbar-right %li @@ -59,4 +59,8 @@ $('#search_button').click(function(){ $('#search_form').submit(); }); + $('#drop').click(function(){ + //$('.dropdown-toggle').dropdown('toggle') + }); + $('.dropdown-toggle').dropdown(); }); \ No newline at end of file