From d9309662f23970765040abb035952de5e9b56734 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Wed, 1 Jun 2016 01:27:20 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D1=85=D0=BE=D0=B4=20=D0=BF=D0=BE=20?= =?UTF-8?q?=D1=8F=D0=BA=D0=BE=D1=80=D1=8E=20=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B1=D0=B5=D0=B7=D0=B5=20=D0=B7=D0=B0=D0=BD=D0=B5?= =?UTF-8?q?=D1=81=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B2=20=D0=B8=D1=81=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=B8=D1=8E=20=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=20=D0=B1=D0=B0=D0=B3=20=D1=81=20=D0=BD=D0=B5?= =?UTF-8?q?=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D1=8C=D1=8E=20=D0=B2=D1=8B=D0=B4=D0=B5=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D1=8D=D0=BB=D0=B5=D0=BC=D0=B5=D0=BD=D1=82=D0=BE=D0=B2?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/rules/RulesPage.jsx | 9 ++++++++- src/pages/rules/rules.scss | 5 ++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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;