Skip to content

Commit 2d7b433

Browse files
committed
#6494 grid.ScrollManager: touchMoveOwner class field
1 parent c16b128 commit 2d7b433

3 files changed

Lines changed: 21 additions & 33 deletions

File tree

src/grid/Container.mjs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,6 @@ class GridContainer extends BaseContainer {
119119
* @protected
120120
*/
121121
initialResizeEvent = true
122-
/**
123-
* Flag for identifying the ownership of a touchmove operation
124-
* @member {Boolean} isTouchMoveOwner=false
125-
* @protected
126-
*/
127-
isTouchMoveOwner = false
128122
/**
129123
* @member {Neo.grid.ScrollManager|null} scrollManager=null
130124
* @protected

src/grid/ScrollManager.mjs

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ class ScrollManager extends Base {
5656
*/
5757
scrollTimeoutId = null
5858

59+
/**
60+
* Flag for identifying the ownership of a touchmove operation
61+
* @member {'container'|'view'|null} touchMoveOwner=null
62+
* @protected
63+
*/
64+
touchMoveOwner = null
65+
5966
/**
6067
* @param {Object} config
6168
*/
@@ -96,11 +103,11 @@ class ScrollManager extends Base {
96103
view.scrollPosition = {x: scrollLeft, y: view.scrollPosition.y};
97104

98105
if (touches) {
99-
if (!view.isTouchMoveOwner) {
100-
me.isTouchMoveOwner = true
106+
if (me.touchMoveOwner !== 'view') {
107+
me.touchMoveOwner = 'container'
101108
}
102109

103-
if (me.isTouchMoveOwner) {
110+
if (me.touchMoveOwner === 'container') {
104111
lastTouchY = touches.lastTouch.clientY - touches.firstTouch.clientY;
105112
deltaY = me.lastTouchY - lastTouchY;
106113

@@ -120,28 +127,22 @@ class ScrollManager extends Base {
120127
* @param {Object} data
121128
*/
122129
onTouchCancel(data) {
123-
let me = this,
124-
{parent} = me;
125-
126-
me.isTouchMoveOwner = false;
127-
me.lastTouchX = 0;
130+
let me = this;
128131

129-
parent.isTouchMoveOwner = false;
130-
parent.lastTouchY = 0
132+
me.touchMoveOwner = null;
133+
me.lastTouchX = 0;
134+
me.lastTouchY = 0
131135
}
132136

133137
/**
134138
* @param {Object} data
135139
*/
136140
onTouchEnd(data) {
137-
let me = this,
138-
{parent} = me;
139-
140-
me.isTouchMoveOwner = false;
141-
me.lastTouchX = 0;
141+
let me = this;
142142

143-
parent.isTouchMoveOwner = false;
144-
parent.lastTouchY = 0
143+
me.touchMoveOwner = null;
144+
me.lastTouchX = 0;
145+
me.lastTouchY = 0
145146
}
146147

147148
/**
@@ -166,11 +167,11 @@ class ScrollManager extends Base {
166167
});
167168

168169
if (touches) {
169-
if (!me.parent.isTouchMoveOwner) {
170-
me.isTouchMoveOwner = true
170+
if (me.touchMoveOwner !== 'container') {
171+
me.touchMoveOwner = 'view'
171172
}
172173

173-
if (me.isTouchMoveOwner) {
174+
if (me.touchMoveOwner === 'view') {
174175
lastTouchX = touches.lastTouch.clientX - touches.firstTouch.clientX;
175176
deltaX = me.lastTouchX - lastTouchX;
176177

src/grid/View.mjs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,6 @@ class GridView extends Component {
147147
]}
148148
}
149149

150-
/**
151-
* Flag for identifying the ownership of a touchmove operation
152-
* @member {Boolean} isTouchMoveOwner=false
153-
* @protected
154-
*/
155-
isTouchMoveOwner = false
156-
157150
/**
158151
* @member {String[]} selectedRows
159152
*/

0 commit comments

Comments
 (0)