Sha256: c2baa434993d617019b423947e847d073d438a1d7dd40b2b0be350218503a294
Contents?: true
Size: 682 Bytes
Versions: 7
Compression:
Stored size: 682 Bytes
Contents
pageflow.History = function(slideshow) { slideshow.on('slideshowchangepage', function() { if(pageflow.features.has('hashchange support')) { window.location.hash = '#' + slideshow.currentPage().attr('id'); } }); $(window).on('hashchange', function() { slideshow.goToByPermaId(getHash()); }); slideshow.goToByPermaId(getPermaId()); function getHash() { var match = window.location.href.match(/#(.*)$/); return match ? match[1] : ''; } function getPermaId() { if (getHash().length) { return getHash(); } else { var match = window.location.href.match(/page=([^&]*)/); return match ? match[1] : ''; } } };
Version data entries
7 entries across 7 versions & 1 rubygems