bug fixes
- click handler event binding - click handler on img elem - trailing space in content - sidebar will-change optimization - sidebar auto to top - sidebar not closed after post - reply form bottom position
This commit is contained in:
@@ -1,17 +1,29 @@
|
||||
import React, {Component} from 'react';
|
||||
import React, {Component, PureComponent} from 'react';
|
||||
import './Sidebar.css';
|
||||
|
||||
export function Sidebar(props) {
|
||||
return (
|
||||
<div className={props.title!==null ? 'sidebar-on' : ''}>
|
||||
<div className="sidebar-shadow" onClick={props.do_close} />
|
||||
<div className="sidebar">
|
||||
{props.content}
|
||||
export class Sidebar extends PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.sidebar_ref=React.createRef();
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
//console.log('sidebar top');
|
||||
this.sidebar_ref.current.scrollTo(0,0);
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className={this.props.title!==null ? 'sidebar-on' : ''}>
|
||||
<div className="sidebar-shadow" onClick={this.props.do_close} />
|
||||
<div ref={this.sidebar_ref} className="sidebar">
|
||||
{this.props.content}
|
||||
</div>
|
||||
<div className="sidebar-title">
|
||||
<a onClick={this.props.do_close}> <span className="icon icon-back" /> </a>
|
||||
{this.props.title}
|
||||
</div>
|
||||
</div>
|
||||
<div className="sidebar-title">
|
||||
<a onClick={props.do_close}> <span className="icon icon-back" /> </a>
|
||||
{props.title}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user