(syntax)
| 66 | } |
| 67 | |
| 68 | handleSyntaxClick(syntax) { |
| 69 | this.setState({ |
| 70 | syntax, |
| 71 | chosen: true |
| 72 | }); |
| 73 | |
| 74 | const scrollTopBefore = findDOMNode(this).getBoundingClientRect().top; |
| 75 | setPreferredSyntax(syntax); |
| 76 | ReactUpdates.flushBatchedUpdates(); |
| 77 | const scrollTopAfter = findDOMNode(this).getBoundingClientRect().top; |
| 78 | |
| 79 | window.scroll( |
| 80 | window.pageXOffset || window.scrollX, |
| 81 | (window.pageYOffset || window.scrollY) - (scrollTopBefore - scrollTopAfter) |
| 82 | ); |
| 83 | } |
| 84 | |
| 85 | render() { |
| 86 | return ( |
nothing calls this directly
no test coverage detected