refactored sections
This commit is contained in:
@@ -11,7 +11,32 @@ var NavigationActions = {
|
||||
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: '/'
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
29
front-ui/app/actions/sectionActions.js
Normal file
29
front-ui/app/actions/sectionActions.js
Normal file
@@ -0,0 +1,29 @@
|
||||
var AppDispatcher = require('../dispatcher/appDispatcher');
|
||||
var SectionConstants = require('../constants/sectionConstants');
|
||||
|
||||
// Define action methods
|
||||
var SectionActions = {
|
||||
|
||||
loadSections: function() {
|
||||
AppDispatcher.handleAction({
|
||||
actionType: SectionConstants.LOAD_SECTIONS
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
setSectionHover: function(section) {
|
||||
AppDispatcher.handleAction({
|
||||
actionType: SectionConstants.SET_SECTION_HOVER,
|
||||
section: section
|
||||
})
|
||||
},
|
||||
|
||||
unsetSectionHover: function() {
|
||||
AppDispatcher.handleAction({
|
||||
actionType: SectionConstants.UNSET_SECTION_HOVER
|
||||
})
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
module.exports = SectionActions;
|
||||
Reference in New Issue
Block a user