# @cjsx React.DOM $ = require('jquery') Backbone = require('backbone') React = require('react') classnames = require('classnames') Cards = require('./cards') Card = require('./card') CardCollection = require('../models/cards') Pagination = require('./pagination') helpers = require('../helpers') config = require('../config') Glyphicon = require('react-bootstrap/lib/Glyphicon') module.exports = React.createClass displayName: 'List' componentDidMount: -> console.log '[views/list] component did mount' @props.cards.on 'sync', @forceUpdate.bind(@, null) componentWillReceiveProps: (nextProps)-> console.log '[views/list] component will receive props' nextProps.cards.on 'sync', @forceUpdate.bind(@, null) atozParam: ()-> @queryParam {sort: 'title', order: 'asc', page: 1}, [] latestParam: ()-> @queryParam {sort: 'updated_at', order: 'desc', page: 1}, [] randomParam: ()-> @queryParam {order: 'random'}, ['sort', 'page'] tagParam: (tag)-> @queryParam {tag: tag}, [] queryParam: (param, deleteKeys)-> query = $.extend {}, @props.cards.query, param for key in deleteKeys delete query[key] $.param(query) render: ->