Sha256: 3e75d144c5611729e6fbc3b79e5b7aca85e138dd7318618565328ef34d6e40d4

Contents?: true

Size: 1.15 KB

Versions: 11

Compression:

Stored size: 1.15 KB

Contents

window.jazzy = {'docset': false}
if (typeof window.dash != 'undefined') {
  document.documentElement.className += ' dash'
  window.jazzy.docset = true
}
if (navigator.userAgent.match(/xcode/i)) {
  document.documentElement.className += ' xcode'
  window.jazzy.docset = true
}

// On doc load, toggle the URL hash discussion if present
$(document).ready(function() {
  if (!window.jazzy.docset) {
    var linkToHash = $('a[href="' + window.location.hash +'"]');
    linkToHash.trigger("click");
  }
});

// On token click, toggle its discussion and animate token.marginLeft
$(".token").click(function(event) {
  if (window.jazzy.docset) {
    return;
  }
  var link = $(this);
  var animationDuration = 300;
  var tokenOffset = "15px";
  var original = link.css('marginLeft') == tokenOffset;
  link.animate({'margin-left':original ? "0px" : tokenOffset}, animationDuration);
  $content = link.parent().parent().next();
  $content.slideToggle(animationDuration);

  // Keeps the document from jumping to the hash.
  var href = $(this).attr('href');
  if (history.pushState) {
    history.pushState({}, '', href);
  } else {
    location.hash = href;
  }
  event.preventDefault();
});

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
jazzy-0.9.6 lib/jazzy/themes/apple/assets/js/jazzy.js
jazzy-0.7.3 lib/jazzy/themes/apple/assets/js/jazzy.js
jazzy-0.7.2 lib/jazzy/themes/apple/assets/js/jazzy.js
jazzy-0.7.1 lib/jazzy/themes/apple/assets/js/jazzy.js
jazzy-0.7.0 lib/jazzy/themes/apple/assets/js/jazzy.js
jazzy-0.6.3 lib/jazzy/themes/apple/assets/js/jazzy.js
jazzy-0.6.2 lib/jazzy/themes/apple/assets/js/jazzy.js
jazzy-0.6.1 lib/jazzy/themes/apple/assets/js/jazzy.js
jazzy-0.6.0 lib/jazzy/themes/apple/assets/js/jazzy.js
jazzy-0.5.0 lib/jazzy/themes/apple/assets/js/jazzy.js
jazzy-0.4.1 lib/jazzy/assets/js/jazzy.js