fixed wierd behavior of the main menu

This commit is contained in:
Edin Dazdarevic
2015-02-15 20:21:45 +01:00
parent f5254cd316
commit d82274d1e1

View File

@@ -31,13 +31,18 @@ var SectionsListComponent = React.createClass({
},
onMouseOut: function() {
SectionActions.unsetSectionHover();
SectionActions.unsetSectionHover();
},
onMouseLeave: function() {
SectionActions.unsetSectionHover();
},
onSectionClick: function(section) {
SectionActions.unsetSectionHover();
NavigationActions.goToSection(section);
return false;
},
onCategoryClick: function(category, section) {
SectionActions.unsetSectionHover();
NavigationActions.goToCategory(new Category(category), section);
return false;
},
@@ -61,13 +66,14 @@ var SectionsListComponent = React.createClass({
{this.state.sections.map(function(section) {
return (
<li key={section.get('id')} role='presentation' style={style}>
<a href="#" onClick={self.onSectionClick.bind(self, section)} onMouseOver={self.onMouseOver.bind(self, section)}>
<li key={section.get('id')} onMouseLeave={self.onMouseOut} onMouseOver={self.onMouseOver.bind(self, section)} role='presentation' style={style}>
<a href="#" onClick={self.onSectionClick.bind(self, section)} >
{ section.get('name') }
</a>
<div style={abStyle} className={section.get('id') !== self.state.hoveredSection ? "hide section-cat-list": "section-cat-list"} >
<ul onMouseLeave={self.onMouseOut} >
<ul >
{section.get('categories').map(function(category) {
return (
<li key={category.id}>