File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 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+
195199 // circular loop
196- if ( conf . circular ) {
200+ if ( conf . circular && self . getSize ( ) > 1 ) {
197201
198202 var cloned1 = self . getItems ( ) . slice ( - 1 ) . clone ( ) . prependTo ( itemWrap ) ,
199203 cloned2 = self . getItems ( ) . eq ( 1 ) . clone ( ) . appendTo ( itemWrap ) ;
225229
226230 // seek over the cloned item
227231 self . seekTo ( 0 , 0 , function ( ) { } ) ;
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 ) {
232+
233+ } else if ( ! conf . circular && self . getSize ( ) > 1 ) {
235234
236235 self . onBeforeSeek ( function ( e , i ) {
237236 setTimeout ( function ( ) {
245244 if ( ! conf . initialIndex ) {
246245 prev . addClass ( conf . disabledClass ) ;
247246 }
247+ } else { // the case where there is one or zero items
248+ prev . addClass ( conf . disabledClass ) ;
249+ next . addClass ( conf . disabledClass ) ;
248250 }
249251
250252 // mousewheel support
You can’t perform that action at this time.
0 commit comments