button: add client option altTraversing to allow one-way response to traversing gestures
This commit is contained in:
parent
d962c1efe0
commit
e07322a520
4 changed files with 15 additions and 1 deletions
|
|
@ -32,6 +32,9 @@ window.CLIENT_SYNC = parseInt(ENV.clientSync) === 0 ? 0 : 1
|
|||
|
||||
window.IOS_TOUCH_POLLING = false
|
||||
|
||||
window.TOGGLE_ALT_TRAVERSING = ENV.altTraversing ? true : false
|
||||
|
||||
|
||||
window.JSON.parseFlex = require('json5').parse
|
||||
|
||||
window.DOM = require('./dom')
|
||||
|
|
|
|||
|
|
@ -140,6 +140,14 @@ class Button extends Widget {
|
|||
|
||||
if (this.active) return
|
||||
|
||||
if (e.traversingStack && TOGGLE_ALT_TRAVERSING) {
|
||||
if (e.traversingStack.firstButtonValue === undefined) {
|
||||
e.traversingStack.firstButtonValue = this.state
|
||||
} else if (e.traversingStack.firstButtonValue !== this.state) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
this.active = true
|
||||
this.setValue(this.state ? this.getProp('off') : this.getProp('on'), {sync: true, send: true, y: e.offsetY, x: e.offsetX})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue