Sha256: 630be85edccacddb86cfe1c57e4060ceb142df197d89e210337a2b6ed63b395f

Contents?: true

Size: 713 Bytes

Versions: 13

Compression:

Stored size: 713 Bytes

Contents

//= require betterjs/twbs_ext/affix_2_1_0

jQuery(function() {

  $('#aside').affix({
    offset: {
      top: function () {
        offset = getInt( $("body").css("padding-top") );
        return (this.top = $("#aside").offset().top - offset)
      }
    }
  });
  
  $('#aside_toggle').affix({
    offset: {
      top: function () {
        if ( $("body").hasClass("fixed-nav") ) {
          var neededTop = $("#aside").offset().top - 50;
        } else {
          var neededTop = $("#aside").offset().top;
        }
        return (this.top = neededTop)
      }
    }
  });
  
  $("body").on( "click", "#aside_toggle", function(e){
    e.preventDefault();
    $('body').toggleClass("with_aside");
  });
  
});

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
better_styles-0.0.0.338 assets/javascripts/betterjs/templates/scroll_to_fix_aside.js
better_styles-0.0.0.337 assets/javascripts/betterjs/templates/scroll_to_fix_aside.js
better_styles-0.0.0.336 assets/javascripts/betterjs/templates/scroll_to_fix_aside.js
better_styles-0.0.0.335 assets/javascripts/betterjs/templates/scroll_to_fix_aside.js
better_styles-0.0.0.334 assets/javascripts/betterjs/templates/scroll_to_fix_aside.js
better_styles-0.0.0.333 assets/javascripts/betterjs/templates/scroll_to_fix_aside.js
better_styles-0.0.0.332 assets/javascripts/betterjs/templates/scroll_to_fix_aside.js
better_styles-0.0.0.331 assets/javascripts/betterjs/templates/scroll_to_fix_aside.js
better_styles-0.0.0.33 assets/javascripts/betterjs/templates/scroll_to_fix_aside.js
better_styles-0.0.5 assets/javascripts/betterjs/templates/scroll_to_fix_aside.js
better_styles-0.0.4 assets/javascripts/betterjs/templates/scroll_to_fix_aside.js
better_styles-0.0.3 assets/javascripts/betterjs/templates/scroll_to_fix_aside.js
better_styles-0.0.2 assets/javascripts/betterjs/templates/scroll_to_fix_aside.js