Sha256: 67003540aca3c40845ab49f1cf7f536563cc0d5ed2266828f0962b03c38afcd3

Contents?: true

Size: 667 Bytes

Versions: 31

Compression:

Stored size: 667 Bytes

Contents

Spree.ready(function() {
  var navHeight = function() {
    return $('.admin-nav-header').outerHeight() + $('.admin-nav-menu').outerHeight() + $('.admin-nav-footer').outerHeight();
  };

  var initStickyNavbar = function() {
    $(".admin-nav-sticky, .admin-nav").stick_in_parent();
  };

  var detachStickyNavbar = function() {
    $(".admin-nav-sticky, .admin-nav").trigger("sticky_kit:detach");
  };

  var checkSideBarFit = function() {
    var fits = navHeight() < $(window).height();

    $('.admin-nav').toggleClass('fits', fits);

    fits ? initStickyNavbar() : detachStickyNavbar();
  };

  checkSideBarFit();
  $(window).on('resize', checkSideBarFit);
});

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
solidus_backend-4.2.0 app/assets/javascripts/spree/backend/navigation.js
solidus_backend-4.1.1 app/assets/javascripts/spree/backend/navigation.js
solidus_backend-4.0.2 app/assets/javascripts/spree/backend/navigation.js
solidus_backend-3.4.4 app/assets/javascripts/spree/backend/navigation.js
solidus_backend-3.4.3 app/assets/javascripts/spree/backend/navigation.js
solidus_backend-4.0.1 app/assets/javascripts/spree/backend/navigation.js
solidus_backend-4.1.0 app/assets/javascripts/spree/backend/navigation.js
solidus_backend-4.0.0 app/assets/javascripts/spree/backend/navigation.js
solidus_backend-3.4.2 app/assets/javascripts/spree/backend/navigation.js
solidus_backend-3.4.1 app/assets/javascripts/spree/backend/navigation.js
solidus_backend-3.4.0 app/assets/javascripts/spree/backend/navigation.js