lib/carte/client/views/content.cjsx in carte-server-0.0.12 vs lib/carte/client/views/content.cjsx in carte-server-0.0.13
- old
+ new
@@ -1,12 +1,13 @@
# @cjsx React.DOM
+$ = require('jquery')
React = require('react')
List = require('./list')
CardCollection = require('../models/cards')
CardModel = require('../models/card')
String = require('string')
-config = require('../../shared/config.json')
+config = require('../config')
module.exports = React.createClass
displayName: 'Content'
componentWillMount: ->
@@ -22,12 +23,10 @@
console.log 'render component'
switch @props.router.current
when "list"
console.log 'list', @props.router.query
cards = new CardCollection()
- cards.query = @props.router.query
- cards.query.sort = 'title' if !cards.query.sort
- cards.query.order = 'asc' if !cards.query.order
+ cards.query = $.extend config.default_query, @props.router.query
cards.fetching = true
cards.fetch success: ()-> cards.fetching = false
title = []
for k, v of cards.query
if k != 'title'