diff --git a/front-ui/Gruntfile.js b/front-ui/Gruntfile.js index a0b4af9..0ca76f5 100644 --- a/front-ui/Gruntfile.js +++ b/front-ui/Gruntfile.js @@ -85,7 +85,9 @@ module.exports = function(grunt) { dest: 'build/ribica.css' }, js: { - src: ['node_modules/jquery/dist/jquery.min.js', 'node_modules/bootstrap/dist/css/bootstrap.min.js', 'build/ribica.bundle.js'], + src: ['node_modules/jquery/dist/jquery.min.js', + 'build/bootstrap.min.js', + 'build/ribica.bundle.js'], dest: 'build/ribica.js' } } @@ -107,4 +109,4 @@ module.exports = function(grunt) { grunt.registerTask('dev', ['browserify', 'config-dev', 'concat:css', 'concat:js', 'connect:server:keepalive']); grunt.registerTask('build', ['browserify', 'config-prod', 'concat:css', 'concat:js']); -}; \ No newline at end of file +}; diff --git a/front-ui/app/components/shared/menuItemListComponent.js b/front-ui/app/components/shared/menuItemListComponent.js index 27dabb6..d3ea6f1 100644 --- a/front-ui/app/components/shared/menuItemListComponent.js +++ b/front-ui/app/components/shared/menuItemListComponent.js @@ -4,6 +4,7 @@ var React = require('react'), Backbone = require('backbone'), NavigationStore = require('../../stores/navigationStore'), MenuItemStore = require('../../stores/menuItemStore'), + CartStore = require('../../stores/cartStore.js'); MenuItemActions = require('../../actions/menuItemActions'), NavigationActions = require('../../actions/navigationActions'); @@ -18,7 +19,10 @@ var MenuItemListComponent = React.createClass({ }, getInitialState: function() { - return MenuItemStore.getState(); + var state = MenuItemStore.getState(); + var cartState = CartStore.getWholeCartState(); + state.cartCount = cartState; + return state; }, componentDidMount: function() { @@ -39,17 +43,9 @@ var MenuItemListComponent = React.createClass({ NavigationActions.goToMenuItem(menuItem); event.preventDefault(); }, - //onCategoryClick: function(category, section) { - //MenuItemActions.unsetSectionHover(); - //NavigationActions.goToCategory(new Category(category), section); - //event.preventDefault(); - //}, - //onSubcategoryClick: function(subcategory) { - //// implement in navigation actions - //// and call - //// when ready - //return false; - //}, + _onCartClick: function() { + NavigationActions.goToCart(); + }, render: function() { var self = this; var style = { @@ -62,8 +58,19 @@ var MenuItemListComponent = React.createClass({