Sha256: d15afbb2d319aac38336e67bce651f71de18db8419351713a8b4d53a29b87213
Contents?: true
Size: 1.07 KB
Versions: 5
Compression:
Stored size: 1.07 KB
Contents
function onlyShow(className) { $("ul.build-scratch").hide(); $("ul.build-new").hide(); $("ul.build-existing").hide(); if (className) { $("ul." + className).show(); } } $( document ).ready(function() { var currentPath = $(location).attr('pathname'); // add active class to the subnav link based on the current page var activeLink = $(".content-nav a").filter(function(i, link) { return(link.pathname == currentPath); }); activeLink.addClass("active"); // allows use to use arrow keys to move back and forward through the docs var keymap = {}; // LEFT keymap[ 37 ] = "#prev"; // RIGHT keymap[ 39 ] = "#next"; $( document ).on( "keyup", function(event) { var href, selector = keymap[ event.which ]; // if the key pressed was in our map, check for the href if ( selector ) { href = $( selector ).attr( "href" ); if ( href ) { // navigate where the link points window.location = href; } } }); });
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
jack-eb-1.4.4 | docs/js/nav.js |
jack-eb-1.4.3 | docs/js/nav.js |
jack-eb-1.4.2 | docs/js/nav.js |
jack-eb-1.4.1 | docs/js/nav.js |
jack-eb-1.4.0 | docs/js/nav.js |