Commit 0cb744d6 by zhanghaozhe

Merge branch 'global-entry-slide-out' into dev

parents d0d4b252 91ca11e5
...@@ -305,6 +305,7 @@ class App extends Component { ...@@ -305,6 +305,7 @@ class App extends Component {
const {history} = this.props const {history} = this.props
const _this = this const _this = this
const entryWidth = this.globalEntry.offsetWidth const entryWidth = this.globalEntry.offsetWidth
const velocityThreshold = 0.4
mc.on('panright tap panend', function (e) { mc.on('panright tap panend', function (e) {
if (e.type === 'tap') { if (e.type === 'tap') {
...@@ -312,7 +313,7 @@ class App extends Component { ...@@ -312,7 +313,7 @@ class App extends Component {
} else if (e.type === 'panright') { } else if (e.type === 'panright') {
_this.globalEntry.style.transform = `translateX(${e.deltaX}px)` _this.globalEntry.style.transform = `translateX(${e.deltaX}px)`
} else { } else {
if (e.deltaX > entryWidth / 2) { if (e.deltaX > entryWidth / 2 || e.velocityX > velocityThreshold) {
_this.globalEntry.style.transition = `.2s` _this.globalEntry.style.transition = `.2s`
_this.globalEntry.style.transform = `translateX(${entryWidth + 10}px)` _this.globalEntry.style.transform = `translateX(${entryWidth + 10}px)`
_this.closeGlobalEntry() _this.closeGlobalEntry()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment