Permalink
Browse files

Set current slide correctly when resizing window. Do not start slides…

…how if resizing window and show is paused.
  • Loading branch information...
1 parent 91a5a10 commit 09094c359915c7eed0e8ad4b5d9e7ad7ad853f8d @jarmo committed May 19, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 public/hackersays.js
View
@@ -41,7 +41,11 @@ $(function() {
$(window).resize(function() {
clearTimeout(reloadTimer);
- reloadTimer = setTimeout(function() { slider.reloadShow() }, 100);
+ reloadTimer = setTimeout(function() {
+ sliderOptions.startingSlide = slider.getCurrentSlide();
+ slider.destroyShow();
+ slider = quotesEl.bxSlider(sliderOptions);
+ }, 100);
});
if (quotesEl.hasClass("via-link")) $("#toolbar .play").click();
@@ -56,6 +60,8 @@ $(function() {
.toggleClass("hide-prev", index == 0)
.toggleClass("hide-next", index == total);
+ if ($("#toolbar .play").hasClass("paused")) return;
+
if (total - index == 5) loadNewQuotes();
clearTimeout(readingTimer);
readingTimer = setTimeout(function() {

0 comments on commit 09094c3

Please sign in to comment.