Skip to content

Commit

Permalink
Merge branch 'master' of github.com:jquerytools/jquerytools
Browse files Browse the repository at this point in the history
  • Loading branch information
bradrobertson committed Aug 31, 2011
2 parents 1ae09b9 + 4b066f9 commit 20a39e5
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/scrollable/scrollable.js
Expand Up @@ -192,12 +192,8 @@
};
});

// next/prev buttons
var prev = find(root, conf.prev).click(function() { self.prev(); }),
next = find(root, conf.next).click(function() { self.next(); });

// circular loop
if (conf.circular && self.getSize() > 1) {
if (conf.circular) {

var cloned1 = self.getItems().slice(-1).clone().prependTo(itemWrap),
cloned2 = self.getItems().eq(1).clone().appendTo(itemWrap);
Expand Down Expand Up @@ -229,8 +225,13 @@

// seek over the cloned item
self.seekTo(0, 0, function() {});

} else if (!conf.circular && self.getSize() > 1) {
}

// next/prev buttons
var prev = find(root, conf.prev).click(function() { self.prev(); }),
next = find(root, conf.next).click(function() { self.next(); });

if (!conf.circular && self.getSize() > 1) {

self.onBeforeSeek(function(e, i) {
setTimeout(function() {
Expand All @@ -244,9 +245,6 @@
if (!conf.initialIndex) {
prev.addClass(conf.disabledClass);
}
} else { // the case where there is one or zero items
prev.addClass(conf.disabledClass);
next.addClass(conf.disabledClass);
}

// mousewheel support
Expand Down

0 comments on commit 20a39e5

Please sign in to comment.