Sha256: 38116b4ec5b7d898a5b0088a5dd27dd5979f12ec8eb46053f769c2dd3c644f33

Contents?: true

Size: 1.59 KB

Versions: 13

Compression:

Stored size: 1.59 KB

Contents

!function ($) {

  $(function(){

    // IE10 viewport hack for Surface/desktop Windows 8 bug
    // See Getting Started docs for more information
    if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
      var msViewportStyle = document.createElement("style");
      msViewportStyle.appendChild(
        document.createTextNode(
          "@-ms-viewport{width:auto!important}"
        )
      );
      document.getElementsByTagName("head")[0].
        appendChild(msViewportStyle);
    }


    var $window = $(window);
    var $body   = $(document.body);

    var navHeight = $('.navbar').outerHeight(true) + 10;

    $body.scrollspy({
      target: '.bs-sidebar',
      offset: navHeight
    });

    $window.on('load', function () {
      $body.scrollspy('refresh');
    });

    $('.bs-docs-container [href=#]').click(function (e) {
      e.preventDefault();
    });

    // back to top
    setTimeout(function () {
      var $sideBar = $('.bs-sidebar');

      $sideBar.affix({
        offset: {
          top: function () {
            var offsetTop      = $sideBar.offset().top;
            var sideBarMargin  = parseInt($sideBar.children(0).css('margin-top'), 10);
            var navOuterHeight = $('.bs-docs-nav').height();

            return (this.top = offsetTop - navOuterHeight - sideBarMargin);
          },
          bottom: function () {
            return (this.bottom = $('.bs-footer').outerHeight(true));
          }
        }
      });
    }, 100);

    setTimeout(function () {
      $('.bs-top').affix();
    }, 100);
});
}(window.jQuery);

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
scms-4.5.1 assets/blank-template/js/application.js
scms-4.5.0 assets/blank-template/js/application.js
scms-4.4.9 assets/blank-template/js/application.js
scms-4.4.8 assets/blank-template/js/application.js
scms-4.4.6 assets/blank-template/js/application.js
scms-4.4.5 assets/blank-template/js/application.js
scms-4.4.4 assets/blank-template/js/application.js
scms-4.4.3 assets/blank-template/js/application.js
scms-4.4.2 assets/blank-template/js/application.js
scms-4.4.1 assets/blank-template/js/application.js
scms-4.4.0 assets/blank-template/js/application.js
scms-4.3.0 assets/blank-template/js/application.js
scms-4.2.6 assets/blank-template/js/application.js