Sha256: 19ace57121d8985af0d5701736ba81f86e2115a4c069776b2692e0ab6c423a12

Contents?: true

Size: 1.69 KB

Versions: 2

Compression:

Stored size: 1.69 KB

Contents

'use strict';

$(document).on('turbolinks:load', function () {
  $('#sidebarToggleLG').click(function () {
    if ($('.wrapper').hasClass('display-right')) {
      $('.wrapper').removeClass('display-right');
      $('.sidebar-right').removeClass('active');
    } else {
      $('.top-nav').toggleClass('sidebar-mini');
      $('aside').toggleClass('sidebar-mini');
      $('footer').toggleClass('sidebar-mini');
      $('.main-container').toggleClass('sidebar-mini');
      $('.main-menu').find('.openable').removeClass('open');
      $('.main-menu').find('.submenu').removeAttr('style');
    }
  });

  $('#sidebarToggleSM').click(function () {
    $('aside').toggleClass('active');
    $('.wrapper').toggleClass('display-left');
  });

  $('.sidebarRight-toggle').click(function () {
    $('.sidebar-right').toggleClass('active');
    $('.wrapper').toggleClass('display-right');
    $('footer').toggleClass('display-right');
    return false;
  });

  $('.sidebar-menu .openable > a').click(function () {
    if (!$('aside').hasClass('sidebar-mini') || Modernizr.mq('(max-width: 991px)')) {
      if ($(this).parent().children('.submenu').is(':hidden')) {
        $(this).parent().siblings().removeClass('open').children('.submenu').slideUp(200);
        $(this).parent().addClass('open').children('.submenu').slideDown(200);
      } else {
        $(this).parent().removeClass('open').children('.submenu').slideUp(200);
      }
    }
    return false;
  });

  if (!$('.sidebar-menu').hasClass('sidebar-mini') || Modernizr.mq('(max-width: 767px)')) {
    $('.openable.open').children('.submenu').slideDown(200);
  }

  return $('#btn-collapse').click(function () {
    $('.sidebar-header').toggleClass('active');
  });
});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
simplify-admin-rails-0.4.1 vendor/assets/theme/simplify_admin/js/common.js
simplify-admin-rails-0.4 vendor/assets/theme/simplify_admin/js/common.js