diff --git a/src/pages/rules/RulesPage.jsx b/src/pages/rules/RulesPage.jsx index 8c62b6d..177d538 100644 --- a/src/pages/rules/RulesPage.jsx +++ b/src/pages/rules/RulesPage.jsx @@ -1,6 +1,6 @@ import React, { Component, PropTypes } from 'react'; -import { Link } from 'react-router'; +import { Link, browserHistory } from 'react-router'; import { FormattedMessage as Message } from 'react-intl'; import { FooterMenu } from 'components/footerMenu'; @@ -98,6 +98,7 @@ export default class RulesPage extends Component { })} key={ruleIndex} id={this.getRuleHash(sectionIndex, ruleIndex)} + onClick={this.onRuleClick} > {item} @@ -114,6 +115,12 @@ export default class RulesPage extends Component { ); } + onRuleClick(event) { + const id = event.currentTarget.id; + const newLocation = browserHistory.createLocation({...location, hash: `#${id}`}); + browserHistory.replace(newLocation); + } + getTitleHash(sectionIndex) { return `rule-${sectionIndex + 1}`; } diff --git a/src/pages/rules/rules.scss b/src/pages/rules/rules.scss index 5fb6a34..cf2e72f 100644 --- a/src/pages/rules/rules.scss +++ b/src/pages/rules/rules.scss @@ -26,7 +26,8 @@ .rulesBody { position: relative; - z-index: -2; + // z-index, чтобы положить :before ниже текста, но выше фона блока + z-index: 0; padding: 20px; background: #fff; @@ -57,6 +58,7 @@ list-style: decimal; position: relative; + cursor: pointer; &:last-of-type { margin-bottom: 0; @@ -64,6 +66,7 @@ &.target { &:before { + cursor: default; $border: 8px solid #ddd8ce; content: ''; position: absolute;