traversing: store traversing state in dom element
This commit is contained in:
parent
0bf1c572ed
commit
93d0113b43
2 changed files with 10 additions and 6 deletions
|
|
@ -269,6 +269,10 @@ module.exports = {
|
|||
|
||||
enableTraversingGestures: function(element, options={}) {
|
||||
|
||||
if (element._traversing) return
|
||||
|
||||
element._traversing = true
|
||||
|
||||
var traversing = options.smart ? TRAVERSING_SAMEWIDGET : true
|
||||
|
||||
function makeEventTraversing(event) {
|
||||
|
|
@ -291,6 +295,10 @@ module.exports = {
|
|||
|
||||
disableTraversingGestures: function(element) {
|
||||
|
||||
if (!element._traversing) return
|
||||
|
||||
delete element._traversing
|
||||
|
||||
DOM.dispatchEvent(element, 'disableTraversingGestures')
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,13 +62,9 @@ module.exports = class Root extends Panel {
|
|||
|
||||
var traversing = this.getProp('traversing')
|
||||
|
||||
if (this._traversing) {
|
||||
disableTraversingGestures(this.widget)
|
||||
this._traversing = false
|
||||
}
|
||||
disableTraversingGestures(this.widget)
|
||||
|
||||
if (traversing && !this._traversing) {
|
||||
this._traversing = true
|
||||
if (traversing) {
|
||||
enableTraversingGestures(this.widget, {smart: typeof traversing === 'string' && traversing.match(/smart|auto/)})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue