Sha256: 6a88b1bdd21a85e3110acb1f5ce1485853e16c4c980a82ee7fa58d50e687c837
Contents?: true
Size: 1.88 KB
Versions: 14
Compression:
Stored size: 1.88 KB
Contents
# @cjsx React.DOM Backbone = require('backbone') $ = require('jquery') React = require('react') helpers = require('../helpers') module.exports = React.createClass displayName: 'Pagination' pageParam: (page)-> query = $.extend {}, @props.cards.query query = $.extend query, {page: page} $.param(query) render: -> <ul className="nav nav-pills pull-right carte-pagination"> <li className="carte-pagination-prev"> { if @props.cards.pagination if @props.cards.pagination.current_page > 1 href = "#/?" + @pageParam(@props.cards.pagination.current_page - 1) else href = "#/?" + @pageParam(@props.cards.pagination.total_pages) else href = "javascript:void(0)" <a href={href} aria-label="Previous"> <span aria-hidden="true">«</span> </a> } </li> <li className="carte-pagination-curr"> { if @props.cards.pagination <a href={"#/?" + @pageParam(@props.cards.pagination.current_page)} onClick={helpers.reload}> {@props.cards.pagination.current_page} / {@props.cards.pagination.total_pages} </a> else <a href="javascript:void(0)"> <i className="glyphicon glyphicon-refresh glyphicon-refresh-animate" /> </a> } </li> <li className="carte-pagination-next"> { if @props.cards.pagination if @props.cards.pagination.current_page < @props.cards.pagination.total_pages href = "#/?" + @pageParam(@props.cards.pagination.current_page + 1) else href = "#/?" + @pageParam(1) else href = "javascript:void(0)" <a href={href} aria-label="Next"> <span aria-hidden="true">»</span> </a> } </li> </ul>
Version data entries
14 entries across 14 versions & 1 rubygems