fix ios pressure helper and click handler
This commit is contained in:
13
src/App.js
13
src/App.js
@@ -17,7 +17,7 @@ class App extends Component {
|
||||
super(props);
|
||||
load_config();
|
||||
this.state={
|
||||
sidebar_title: '',
|
||||
sidebar_title: null,
|
||||
sidebar_content: null, // determine status of sidebar
|
||||
mode: 'list', // list, single, search, attention
|
||||
search_text: null,
|
||||
@@ -33,11 +33,11 @@ class App extends Component {
|
||||
}
|
||||
|
||||
on_pressure() {
|
||||
if(this.state.sidebar_content)
|
||||
this.setState({
|
||||
sidebar_title: '',
|
||||
sidebar_content: null,
|
||||
});
|
||||
if(this.state.sidebar_title!==null)
|
||||
this.setState((prevState)=>({
|
||||
sidebar_title: null,
|
||||
sidebar_content: prevState.sidebar_content,
|
||||
}));
|
||||
else
|
||||
this.set_mode('list',null);
|
||||
}
|
||||
@@ -97,6 +97,7 @@ class App extends Component {
|
||||
)}</TokenCtx.Consumer>
|
||||
<Sidebar do_close={()=>{
|
||||
this.setState({
|
||||
sidebar_title: null,
|
||||
sidebar_content: null,
|
||||
});
|
||||
}} content={this.state.sidebar_content} title={this.state.sidebar_title} />
|
||||
|
||||
11
src/Flows.js
11
src/Flows.js
@@ -173,6 +173,17 @@ class FlowSidebar extends PureComponent {
|
||||
this.reply_ref=React.createRef();
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
this.setState({
|
||||
attention: nextProps.attention,
|
||||
info: nextProps.info,
|
||||
replies: nextProps.replies,
|
||||
loading_status: 'done',
|
||||
});
|
||||
this.color_picker=nextProps.color_picker;
|
||||
this.syncState=nextProps.sync_state||(()=>{});
|
||||
}
|
||||
|
||||
set_variant(cid,variant) {
|
||||
this.setState((prev)=>{
|
||||
if(cid)
|
||||
|
||||
@@ -10,10 +10,6 @@
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.pressure-no-select * {
|
||||
user-select: none !important;
|
||||
}
|
||||
|
||||
.pressure-box-fired {
|
||||
border-color: orangered;
|
||||
pointer-events: initial !important;
|
||||
|
||||
@@ -42,7 +42,6 @@ export class PressureHelper extends Component {
|
||||
change: (force)=>{
|
||||
if(!this.state.fired) {
|
||||
if(force>=.999) {
|
||||
document.body.classList.add('pressure-no-select');
|
||||
this.do_fire();
|
||||
}
|
||||
else
|
||||
@@ -56,7 +55,6 @@ export class PressureHelper extends Component {
|
||||
level: 0,
|
||||
fired: false,
|
||||
});
|
||||
document.body.classList.remove('pressure-no-select');
|
||||
},
|
||||
}, {
|
||||
polyfill: false,
|
||||
|
||||
@@ -3,7 +3,7 @@ import './Sidebar.css';
|
||||
|
||||
export function Sidebar(props) {
|
||||
return (
|
||||
<div className={props.content ? 'sidebar-on' : ''}>
|
||||
<div className={props.title!==null ? 'sidebar-on' : ''}>
|
||||
<div className="sidebar-shadow" onClick={props.do_close} />
|
||||
<div className="sidebar">
|
||||
{props.content}
|
||||
|
||||
Submodule src/react-lazyload updated: b985b694ee...1b0c9e258d
Reference in New Issue
Block a user