cleaned up ugly url code

This commit is contained in:
Edin Dazdarevic
2015-02-07 18:16:21 +01:00
parent 280a2e2edb
commit 7770e59b81
5 changed files with 18 additions and 17 deletions

View File

@@ -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;

View File

@@ -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) {