var React = require('react'), MenuItemCollection = require('../../models/menuItemCollection'), MenuItem = require('../../models/menuItem'), Backbone = require('backbone'), NavigationStore = require('../../stores/navigationStore'), MenuItemStore = require('../../stores/menuItemStore'), MenuItemActions = require('../../actions/menuItemActions'), NavigationActions = require('../../actions/navigationActions'); Backbone.$ = $; var MenuItemListComponent = React.createClass({ _onChange: function () { if (this.isMounted()) { this.setState(MenuItemStore.getState()); } }, getInitialState: function() { return MenuItemStore.getState(); }, componentDidMount: function() { MenuItemStore.addChangeListener(this._onChange); MenuItemActions.loadMenuItems(); }, onMouseOver: function(menuItem) { MenuItemActions.setMenuItemHover(menuItem); }, onMouseOut: function() { MenuItemActions.unsetMenuItemHover(); }, onMouseLeave: function() { MenuItemActions.unsetMenuItemHover(); }, onMenuItemClick: function(menuItem) { MenuItemActions.unsetMenuItemHover(); 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; //}, render: function() { var self = this; var style = { position: 'relative' }; var abStyle = { position: 'absolute' }; return (
{menuSubItem.title}