bootstrap 4苗条的CSS手风琴没有关闭

时间:2019-05-17 12:27:22

标签: css ruby-on-rails-4 bootstrap-4 slim-lang

我试图在我打开另一个菜单组时折叠关闭打开的菜单组,我的手风琴打开得很好,但是在我打开另一个菜单组时关闭所有打开的菜单组,没有任何建议 谢谢   这是我的sidebar.html.slim文件

这是我的瘦文件,我正在使用bootstrap,css,slim-lang和RoR

#mySidenav.sidenav
  .col-md-12 style="margin-bottom:10px;"
    .col-md-6.text-left
      = link_to company_dashboard_path, class: 'logo' do
        span.logo
          = image_tag company_logo_url(@company, :small), alt: "Logo", class: 'img-responsive'
    .col-md-6.text-right.closebtn
      = link_to "#", class: 'logo-side-menu no-action' do
        span.glyphicon.glyphicon-menu-hamburger.close-nav aria-hidden="true"
  .clearfix
  div.sidebar-menu
    - @company = @company || Company.current
    - if @company
      - tab = @company.vendor? ? :outbound : :inbound
      = link_to company_dashboard_path, class: "#{'active' if params[:controller] == 'company/dashboards' and params[:action] == 'show'}" do
        = image_tag 'dashboard@1x.png'
        span.title Dashboard
    #accordion
      #management-tab
        h4
          a aria-controls="management-colapse-tab" data-toggle="collapse" href="#management-colapse-tab"
            strong Management
      #management-colapse-tab.panel-collapse.collapse.in data-parent="#accordion" aria-labelledby="management-tab"
          .panel-body.no-padding
            - if @company.is_equipment_sp? or @company.client?
              - if loyalty(nil, "company/dispatch").index?
                = link_to company_dispatch_index_path, class: "#{'active' if params[:controller] == 'company/dispatch'}" do
                  = image_tag 'dispatch-icon.png', size: '40'
                  span.title Calendar
            - if loyalty(nil, "company/locations").mapview?
              = link_to mapview_company_locations_path, class: "#{'active' if params[:controller] == 'company/locations' and action_name == 'mapview'}" do
                = image_tag 'map_icon.png', size: '40'
                span.title Map
            - if loyalty(nil, "company/work_orders").index?
              = link_to company_work_orders_path(tab: tab), class: "#{'active' if params[:controller] == 'company/work_orders'}" do
                = image_tag 'workorders@1x.png', size: '40'
                span.title  = @company.is_janitorial_sp? ? 'Jobs' : 'Work Order'

      #sales-tab
        h4
          a aria-controls="sales-colapse-tab"  data-toggle="collapse" href="#sales-colapse-tab"
            strong Sales
      #sales-colapse-tab.panel-collapse.collapse.in data-parent="#accordion" aria-labelledby="sales-tab"
          .panel-body.no-padding
            - if loyalty(nil, 'company/agreement_contracts').index?
              - url = @company.vendor? ? company_agreement_contracts_path(mastertab: tab, tab: :attention) : company_agreement_contracts_path(mastertab: tab, tab: :current)
              = link_to url, class: "#{'active' if params[:controller] == 'company/agreement_contracts'}"  do
                = image_tag 'contracts@1x.png', size: '40'
                span.title Agreements
            - if loyalty(nil, 'company/proposals').index?
              = link_to company_proposals_path(tab: tab), class: "#{'active' if params[:controller] == 'company/proposals'}" do
                = image_tag 'proposals@1x.png', size: '40'
                span.title Proposals

      #support-tab
        h4
          a aria-controls="support-colapse-tab" data-toggle="collapse" href="#support-colapse-tab"
            strong Support
      #support-colapse-tab.panel-collapse.collapse.in data-parent="#accordion" aria-labelledby="support-tab"
          .panel-body.no-padding
            - if !@company.vendor?
              = link_to company_service_requests_path, class: "#{'active' if params[:controller] == 'company/service_requests'}" do
                = image_tag 'service-request-icon.png', size: '40'
                span.title Service Request 

0 个答案:

没有答案