cleaned up ugly url code
This commit is contained in:
@@ -23,13 +23,12 @@ var ByCategory = React.createClass({
|
||||
},
|
||||
onFCClick: function(fc, fcv) {
|
||||
|
||||
alert(fc.field_name);
|
||||
var q = {};
|
||||
q[fc.field_name] = fcv.filter_value;
|
||||
// TODO: fix this, clean this up
|
||||
var s = new Section({name: 'meho'});
|
||||
var c = this.state.category;
|
||||
NavigationActions.goToCategory({id: c.get('id'), name: c.get('name')}, s, q)
|
||||
var section = new Section(this.state.category.get('section'));
|
||||
var category = this.state.category;
|
||||
NavigationActions.goToCategory(category, section, q)
|
||||
},
|
||||
render: function() {
|
||||
var self = this;
|
||||
|
||||
@@ -8,7 +8,8 @@ var React = require('react'),
|
||||
SectionStore = require('../../stores/sectionStore'),
|
||||
SectionActions = require('../../actions/sectionActions.js'),
|
||||
NavigationActions = require('../../actions/navigationActions'),
|
||||
Section = require('../../models/section');
|
||||
Section = require('../../models/section'),
|
||||
Category = require('../../models/category');
|
||||
|
||||
var BySection = React.createClass({
|
||||
mixins: [Router.State],
|
||||
@@ -57,7 +58,7 @@ var BySection = React.createClass({
|
||||
</div> )
|
||||
},
|
||||
onCategoryClick: function(category, section) {
|
||||
NavigationActions.goToCategory(category, section);
|
||||
NavigationActions.goToCategory(new Category(category), section);
|
||||
|
||||
},
|
||||
componentWillReceiveProps: function(nextProps) {
|
||||
|
||||
Reference in New Issue
Block a user