43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
var AppDispatcher = require('../dispatcher/appDispatcher');
|
|
var NavigationConstants = require('../constants/navigationConstants');
|
|
|
|
// Define action methods
|
|
var NavigationActions = {
|
|
|
|
// select item
|
|
goToItemDetails: function(item) {
|
|
console.log("Going to item details");
|
|
AppDispatcher.handleAction({
|
|
actionType: NavigationConstants.CHANGE_URL,
|
|
url: '/artikal/' + item.get('id') +'/' + item.get('name')
|
|
});
|
|
},
|
|
|
|
goToSection: function(section) {
|
|
console.log("Going to item details");
|
|
AppDispatcher.handleAction({
|
|
actionType: NavigationConstants.CHANGE_URL,
|
|
url: '/sekcija/'+ section.get('id') + '/' + section.get('name')
|
|
});
|
|
},
|
|
|
|
goToCategory: function(category,section) {
|
|
console.log("Going to item details");
|
|
AppDispatcher.handleAction({
|
|
actionType: NavigationConstants.CHANGE_URL,
|
|
url: '/sekcija/' + section.get('name') +'/kategorija/'+ category.id + '/' + category.name
|
|
});
|
|
},
|
|
|
|
goToSubCategory: function(subCategory) {
|
|
// TODO: implement when ready
|
|
AppDispatcher.handleAction({
|
|
actionType: NavigationConstants.CHANGE_URL,
|
|
url: '/'
|
|
});
|
|
},
|
|
|
|
|
|
};
|
|
|
|
module.exports = NavigationActions; |