没有数据时删除下拉内容

时间:2016-01-11 20:26:17

标签: css ruby-on-rails twitter-bootstrap-3 haml

我有一个显示通知的铃声图标下方的下拉菜单,但是当没有可用的数据时,它会在点击时显示:

drop

我的haml:

%nav.navbar.navbar-default
        .container
            .navbar-brand= link_to "wat", root_path
            - if user_signed_in?
                %ul.nav.navbar-nav.navbar-right
                    %li.nav-item.btn-group{"data-behavior"=>"notifications"}
                        %a#dropdownMenu1.dropdown-toggle.nav-link{"aria-expanded" => "false", "aria-haspopup" => "true", "data-behavior" => "notifications-link", "data-toggle" => "dropdown", :type => "button"}
                            = fa_icon "bell"

                            %span.notifs{"data-behavior" => "unread-count"} 
                        .dropdown-menu{"aria-labelledby" => "dropdownMenu1", "data-behavior" => "notification-items"}

如何删除小矩形?

1 个答案:

答案 0 :(得分:1)

在添加<nav class="navbar navbar-default navbar-fixed-top" id="second_nav"> div

之前检查是否有数据
.dropdown-menu