Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Do not append prev & next button when just one image for Carousel3d

It will be strange behavior when just one image in Carousel3d container.

For me, My case is that  extract image for a markdown blog. Sometime, just one image in blogs.
  • Loading branch information...
greengerong committed Aug 7, 2015
1 parent 04128e3 commit 235586faa232b191b4e89dc96df50b876ade6330
Showing with 10 additions and 9 deletions.
  1. +10 −9 src/Carousel3d.js
@@ -33,15 +33,16 @@
}
this.appendChild(childContent);
}.bind(this));

//create prev/next buttons
this._prevButton = $('<div data-prev-button></div>')[0];
$(this.el).append(this._prevButton);
$(this._prevButton).click(this.prev.bind(this));
this._nextButton = $('<div data-next-button></div>')[0];
$(this.el).append(this._nextButton);
$(this._nextButton).click(this.next.bind(this));


if (childrenWrapperObj.numChildren() > 1) {
//create prev/next buttons
this._prevButton = $('<div data-prev-button></div>')[0];
$(this.el).append(this._prevButton);
$(this._prevButton).click(this.prev.bind(this));
this._nextButton = $('<div data-next-button></div>')[0];
$(this.el).append(this._nextButton);
$(this._nextButton).click(this.next.bind(this));
}
this.rotate(currentIndex);
};

0 comments on commit 235586f

Please sign in to comment.
You can’t perform that action at this time.