Sha256: dba97e1347a1f2422102ffcb0f6bf311aeefb8b38f056a4f94841019f251e04a

Contents?: true

Size: 1.99 KB

Versions: 4

Compression:

Stored size: 1.99 KB

Contents

/ Main Sidebar Container
%aside.main-sidebar.sidebar-dark-primary.elevation-4{ data: { controller: 'left-nav' }}
  / Brand Logo
  %a.brand-link{ href: "/", class: sidebar_background_class }
    %img.brand-image.img-circle.elevation-3{:alt => @context.logo.alt, :src => @context.logo.url, :style => "opacity: .8"}/
    %span.brand-text.font-weight-light= sidebar_context_name
  / Sidebar
  .sidebar
    / SidebarSearch Form
    .form-inline{ style: 'padding-top: 7px' }
      .input-group{"data-widget" => "sidebar-search"}
        %input.form-control.form-control-sidebar{"aria-label" => "Search Menu Items", :placeholder => "Search Menu Items", :type => "search"}/
        .input-group-append
          %button.btn.btn-sidebar
            %i.fas.fa-search.fa-fw
    / Sidebar Menu
    %nav.mt-2
      %ul.nav.nav-pills.nav-sidebar.nav-compact.flex-column{"data-accordion" => "false", "data-widget" => "treeview", :role => "menu"}
        - @context.menu_items.each do |menu_item|
          = render Olivander::Components::MenuItemComponent.new(menu_item)


:javascript
  $(document).ready(function(){
    function getUrl() {
      const reg = /\/new|\/[0-9]+[\/edit]*/,
            url = "" + window.location;
      return url.replace(reg, '');
    }
    const url = getUrl();

    $('ul.nav-sidebar a').filter(function() {
      return this.href == url;
    }).addClass('active');

    $('ul.nav-sidebar a').filter(function() {
      return this.href == url;
    }).parent().addClass('active');

    $('ul.nav-treeview a').filter(function() {
      return this.href == url;
    }).parentsUntil(".sidebar-menu > .nav-treeview").addClass('menu-open');

    $('ul.nav-treeview a').filter(function() {
      return this.href == url;
    }).addClass('active');

    $('li.has-treeview a').filter(function() {
      return this.href == url;
    }).addClass('active');

    $('ul.nav-treeview a').filter(function() {
      return this.href == url;
    }).parentsUntil(".sidebar-menu > .nav-treeview").children(0).addClass('active');
  });

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
five-two-nw-olivander-0.1.2.48 app/views/layouts/olivander/adminlte/_sidebar.html.haml
five-two-nw-olivander-0.1.2.47 app/views/layouts/olivander/adminlte/_sidebar.html.haml
five-two-nw-olivander-0.1.2.46 app/views/layouts/olivander/adminlte/_sidebar.html.haml
five-two-nw-olivander-0.1.2.45 app/views/layouts/olivander/adminlte/_sidebar.html.haml