Permalink
Browse files

Cleanup/hide previous and next buttons manually since bxSlider does n…

…ot do that when prev- and nextSelectors are used.
  • Loading branch information...
1 parent 1877176 commit 342efa95de3681eb87e5e018ce7142cb14618bde @jarmo committed May 19, 2012
Showing with 19 additions and 3 deletions.
  1. +7 −1 public/hackersays.js
  2. +12 −2 public/themes/base.scss
View
@@ -40,12 +40,17 @@ $(function() {
});
if (quotesEl.hasClass("via-link"))
- $(".pause").click();
+ $("#toolbar .play").click();
function slideChange(index, total, slide) {
slide = $(slide);
+ total--;
+
History.replaceState(null, "Hacker Says - quote by " + slide.find("cite").text(), slide.data("id"));
_gaq.push(['_trackPageview']);
+ $("#toolbar")
+ .toggleClass("hide-prev", index == 0)
+ .toggleClass("hide-next", index == total);
if (total - index == 5) loadNewQuotes();
clearTimeout(readingTimer);
@@ -62,6 +67,7 @@ $(function() {
sliderOptions.startingSlide = slider.getCurrentSlide();
// we need to destroy the show before appending new quotes, sigh :(
slider.destroyShow()
+ $("#toolbar").find(".bx-prev, .bx-next").remove();
$.each(quotes, function(i, quote) {
var template = $("#template").clone()
View
@@ -65,13 +65,23 @@ strong { font-weight: bolder; }
&.paused { background-image: inline-image("control-pause.png"); }
}
- .bx-prev, .prev {
+ .bx-prev {
float: left; margin-top: 5px;
background-image: inline-image("control-prev.png");
}
- .bx-next, .next {
+
+ &.hide-prev {
+ .bx-prev { visibility: hidden; }
+ }
+
+ .bx-next {
float: right; margin-top: 5px;
background-image: inline-image("control-next.png");
}
+
+ &.hide-next {
+ .bx-next { visibility: hidden; }
+ }
+
}

0 comments on commit 342efa9

Please sign in to comment.