Sha256: 664661b4e923a3c756fb52c286943325e13fa75c7a95096a3ee2c670b0cb4573

Contents?: true

Size: 732 Bytes

Versions: 6

Compression:

Stored size: 732 Bytes

Contents

$(document).on('turbolinks:load', function() {
  $(function ($) {
    var $body = $('body'),
        $slice = $('#sidebar-footer .brand')

    // On click, capture state and save it in localStorage
    $($.AdminLTE.options.sidebarToggleSelector).click(function () {
      localStorage.setItem('sidebar', $body.hasClass('sidebar-collapse') ? 1 : 0);
    });

    // On ready, read the set state and collapse if needed
    if (window.width >= 768){
      if (localStorage.getItem('sidebar') === '0') {
        $body.addClass('disable-animations sidebar-collapse');
        $slice.toggleClass('hidden')
        requestAnimationFrame(function () {
          $body.removeClass('disable-animations');
        });
      }
    }

  });
});

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
keppler-2.0.7 installer/core/app/assets/javascripts/admin/sidebar.js
keppler-2.0.6 installer/core/app/assets/javascripts/admin/sidebar.js
keppler-2.0.5 installer/core/app/assets/javascripts/admin/sidebar.js
keppler-2.0.4.p1 installer/core/app/assets/javascripts/admin/sidebar.js
keppler-2.0.4.pre.p1 installer/core/app/assets/javascripts/admin/sidebar.js
keppler-2.0.4 installer/core/app/assets/javascripts/admin/sidebar.js