Skip to content

Commit

Permalink
fix:tab switch broken in ff
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyadam committed Jan 11, 2018
1 parent 5610b55 commit 6814f1e
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/component/compare/compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class Compare extends Nerv.Component {

componentDidMount () {}

setCurrentIdx = idx => {
setCurrentIdx (idx, event) {
const tg = event.target
const siblings = tg.parentNode.parentNode.children
for (let i in siblings) {
Expand All @@ -119,33 +119,25 @@ class Compare extends Nerv.Component {
<li
key='0'
className='current'
onClick={() => {
this.setCurrentIdx(0)
}}
onClick={this.setCurrentIdx.bind(this, 0)}
>
<span className='compare_js'>JS Framework</span>
</li>
<li
key='1'
onClick={() => {
this.setCurrentIdx(1)
}}
onClick={this.setCurrentIdx.bind(this, 1)}
>
<span className='compare_mu'>Memory usage</span>
</li>
<li
key='2'
onClick={() => {
this.setCurrentIdx(2)
}}
onClick={this.setCurrentIdx.bind(this, 2)}
>
<span className='compare_ui'>UI Bench</span>
</li>
<li
key='3'
onClick={() => {
this.setCurrentIdx(3)
}}
onClick={this.setCurrentIdx.bind(this, 3)}
>
<span className='compare_db'>DB Monster (fps)</span>
</li>
Expand Down

0 comments on commit 6814f1e

Please sign in to comment.