Sha256: b41a271234a2b428778adaa3c1d54d4ae1537be0a8b709095b739d13e8c02b34

Contents?: true

Size: 815 Bytes

Versions: 5

Compression:

Stored size: 815 Bytes

Contents

$(document).ready(function () {
  $('#active_admin_content .table_tools').append('<a id="toggleFilters" href="#" class=\'epon\'>Filtres</a>');

  if (!window.location.search.includes('Filter') && $('body').hasClass('index')) {
    $('div#sidebar').hide();
    $('#main_content').css({ 'margin-right': '0px' });
    $('a#toggleFilters').removeClass('epon');
  }

  $('a#toggleFilters').click(function () {
    $('div#sidebar').toggle();
    $(this).toggleClass('epon');
    if ($('div#sidebar').is(':hidden')) {
      $('#main_content').css({ 'margin-right': '0px' });
      $('body #collection_selection').css({ 'width': 'unset' });
    } else {
      $('#main_content').css({ 'margin-right': '0px' });
      $('body #collection_selection').css({ 'width': 'calc(100% - 294px)', 'overflow': 'auto' });
    }
  })
})

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
light_admin-1.1.0 app/assets/javascripts/light_admin/filters_toggle.js
light_admin-1.0.9 app/assets/javascripts/light_admin/filters_toggle.js
light_admin-1.0.8 app/assets/javascripts/light_admin/filters_toggle.js
light_admin-1.0.7 app/assets/javascripts/light_admin/filters_toggle.js
light_admin-1.0.6 app/assets/javascripts/light_admin/filters_toggle.js