xmcp 6 years ago
parent
commit
978d688f3f
  1. 8
      src/Common.js
  2. 6
      src/Sidebar.css

8
src/Common.js

@ -158,16 +158,16 @@ export class ClickHandler extends PureComponent {
} }
on_begin(e) { on_begin(e) {
//console.log('click',e.screenY,e.screenX); //console.log('click',(e.touches?e.touches[0]:e).screenY,(e.touches?e.touches[0]:e).screenX);
this.setState({ this.setState({
moved: false, moved: false,
init_y: e.screenY, init_y: (e.touches?e.touches[0]:e).screenY,
init_x: e.screenX, init_x: (e.touches?e.touches[0]:e).screenX,
}); });
} }
on_move(e) { on_move(e) {
if(!this.state.moved) { if(!this.state.moved) {
let mvmt=Math.abs(e.screenY-this.state.init_y)+Math.abs(e.screenX-this.state.init_x); let mvmt=Math.abs((e.touches?e.touches[0]:e).screenY-this.state.init_y)+Math.abs((e.touches?e.touches[0]:e).screenX-this.state.init_x);
//console.log('move',mvmt); //console.log('move',mvmt);
if(mvmt>this.MOVE_THRESHOLD) if(mvmt>this.MOVE_THRESHOLD)
this.setState({ this.setState({

6
src/Sidebar.css

@ -22,7 +22,7 @@
height: 100%; height: 100%;
background-color: rgba(255,255,255,.7); background-color: rgba(255,255,255,.7);
overflow-y: auto; overflow-y: auto;
padding-top: 2em; padding-top: 3em;
padding-bottom: 1em; padding-bottom: 1em;
} }
@ -44,9 +44,7 @@
top: 0; top: 0;
line-height: 3em; line-height: 3em;
padding-left: .5em; padding-left: .5em;
padding-bottom: .5em; background-color: rgba(255,255,255,.6);
margin-bottom: -.5em;
background-image: linear-gradient(top,rgba(255,255,255,.7) 50%,rgba(255,255,255,0) 100%);
pointer-events: none; pointer-events: none;
} }
.sidebar-title a { .sidebar-title a {

Loading…
Cancel
Save