Skip to content

Commit 20a39e5

Browse files
author
bradrobertson
committed
Merge branch 'master' of github.com:jquerytools/jquerytools
2 parents 1ae09b9 + 4b066f9 commit 20a39e5

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/scrollable/scrollable.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,8 @@
192192
};
193193
});
194194

195-
// next/prev buttons
196-
var prev = find(root, conf.prev).click(function() { self.prev(); }),
197-
next = find(root, conf.next).click(function() { self.next(); });
198-
199195
// circular loop
200-
if (conf.circular && self.getSize() > 1) {
196+
if (conf.circular) {
201197

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

230226
// seek over the cloned item
231227
self.seekTo(0, 0, function() {});
232-
233-
} else if (!conf.circular && self.getSize() > 1) {
228+
}
229+
230+
// next/prev buttons
231+
var prev = find(root, conf.prev).click(function() { self.prev(); }),
232+
next = find(root, conf.next).click(function() { self.next(); });
233+
234+
if (!conf.circular && self.getSize() > 1) {
234235

235236
self.onBeforeSeek(function(e, i) {
236237
setTimeout(function() {
@@ -244,9 +245,6 @@
244245
if (!conf.initialIndex) {
245246
prev.addClass(conf.disabledClass);
246247
}
247-
} else { // the case where there is one or zero items
248-
prev.addClass(conf.disabledClass);
249-
next.addClass(conf.disabledClass);
250248
}
251249

252250
// mousewheel support

0 commit comments

Comments
 (0)