Skip to content

Instantly share code, notes, and snippets.

@bigardone
Created June 17, 2015 15:25
Show Gist options
  • Save bigardone/7db0b4b463155f360546 to your computer and use it in GitHub Desktop.
Save bigardone/7db0b4b463155f360546 to your computer and use it in GitHub Desktop.
Paginator Section
this.PaginatorSection = React.createClass(
{
displayName: "PaginatorSection",
_handleOnClick: function(e) {
return this.props.onPaginate(e)
},
render: function() {
var e;
return this.props.totalPages > 1 ? React.DOM.ul({className: "pagination"}, function() {
var t, n, r;
for (r = [], e = t = 1, n = this.props.totalPages; n >= 1 ? n >= t : t >= n; e = n >= 1 ? ++t : --t)
r.push(React.DOM.li({key: e}, e === this.props.currentPage ? React.DOM.span(null, "\xa0") : PaginatorLink({pageNumber: e,onPaginatorLinkClick: this._handleOnClick})));
return r
}.call(this)) : React.DOM.div(null, "\xa0")
}
}
)
@goldnuggets24
Copy link

Thank you soooo much for converting this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment