From a4e4c8540f1216473c35f9f6cca84f78f14c4a3f Mon Sep 17 00:00:00 2001 From: Jeremy Banks Date: Mon, 25 Jun 2012 12:57:56 -0300 Subject: [PATCH 1/2] Updating hash plugin to behave correctly in the presence of tag. --- extensions/hash/deck.hash.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/hash/deck.hash.js b/extensions/hash/deck.hash.js index 82f8021..048b647 100644 --- a/extensions/hash/deck.hash.js +++ b/extensions/hash/deck.hash.js @@ -110,6 +110,7 @@ slide. /* Update permalink, address bar, and state class on a slide change */ .bind('deck.change', function(e, from, to) { var hash = '#' + $[deck]('getSlide', to).attr('id'), + hashPath = window.location.href.replace(/#.*/, '') + hash, opts = $[deck]('getOptions'), osp = opts.classes.onPrefix, $c = $[deck]('getContainer'); @@ -117,9 +118,9 @@ slide. $c.removeClass(osp + $[deck]('getSlide', from).attr('id')); $c.addClass(osp + $[deck]('getSlide', to).attr('id')); - $(opts.selectors.hashLink).attr('href', hash); + $(opts.selectors.hashLink).attr('href', hashPath); if (Modernizr.history) { - window.history.replaceState({}, "", hash); + window.history.replaceState({}, "", hashPath); } }); From e3564f29ab3536cb1eec077cf33c7658dfa663c8 Mon Sep 17 00:00:00 2001 From: Jeremy Banks Date: Fri, 29 Jun 2012 12:25:55 -0300 Subject: [PATCH 2/2] Updating navigation plugin to behave correctly in the presence of tag. --- extensions/navigation/deck.navigation.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/navigation/deck.navigation.js b/extensions/navigation/deck.navigation.js index 0c72fec..3e04579 100644 --- a/extensions/navigation/deck.navigation.js +++ b/extensions/navigation/deck.navigation.js @@ -18,15 +18,16 @@ This module adds clickable previous and next links to the deck. last = $[deck]('getSlides').length - 1, prevSlide = $[deck]('getSlide', to - 1), nextSlide = $[deck]('getSlide', to + 1), + hrefBase = window.location.href.replace(/#.*/, ''), prevId = prevSlide ? prevSlide.attr('id') : undefined; nextId = nextSlide ? nextSlide.attr('id') : undefined; $(opts.selectors.previousLink) .toggleClass(opts.classes.navDisabled, !to) - .attr('href', '#' + (prevId ? prevId : '')); + .attr('href', hrefBase + '#' + (prevId ? prevId : '')); $(opts.selectors.nextLink) .toggleClass(opts.classes.navDisabled, to === last) - .attr('href', '#' + (nextId ? nextId : '')); + .attr('href', hrefBase + '#' + (nextId ? nextId : '')); }; /*