MDL-64678 assign: More ios touch

Only disable touch scrolling when the touch event is within the drawing region of the canvas.
This commit is contained in:
Damyon Wiese 2019-01-24 09:44:22 +08:00
parent 89d1238962
commit a0e3d29fcf
4 changed files with 22 additions and 10 deletions

View File

@ -4779,7 +4779,7 @@ EDITOR.prototype = {
*/
disable_touch_scroll: function() {
if (this.event_listener_options_supported()) {
document.addEventListener('touchmove', this.stop_touch_scroll, {passive: false});
document.addEventListener('touchmove', this.stop_touch_scroll.bind(this), {passive: false});
}
},
@ -4788,8 +4788,12 @@ EDITOR.prototype = {
* @param {Object} e
*/
stop_touch_scroll: function(e) {
e.stopPropagation();
e.preventDefault();
var drawingregion = this.get_dialogue_element(SELECTOR.DRAWINGREGION);
if (drawingregion.contains(e.target)) {
e.stopPropagation();
e.preventDefault();
}
}
};

View File

@ -4779,7 +4779,7 @@ EDITOR.prototype = {
*/
disable_touch_scroll: function() {
if (this.event_listener_options_supported()) {
document.addEventListener('touchmove', this.stop_touch_scroll, {passive: false});
document.addEventListener('touchmove', this.stop_touch_scroll.bind(this), {passive: false});
}
},
@ -4788,8 +4788,12 @@ EDITOR.prototype = {
* @param {Object} e
*/
stop_touch_scroll: function(e) {
e.stopPropagation();
e.preventDefault();
var drawingregion = this.get_dialogue_element(SELECTOR.DRAWINGREGION);
if (drawingregion.contains(e.target)) {
e.stopPropagation();
e.preventDefault();
}
}
};

View File

@ -1503,7 +1503,7 @@ EDITOR.prototype = {
*/
disable_touch_scroll: function() {
if (this.event_listener_options_supported()) {
document.addEventListener('touchmove', this.stop_touch_scroll, {passive: false});
document.addEventListener('touchmove', this.stop_touch_scroll.bind(this), {passive: false});
}
},
@ -1512,8 +1512,12 @@ EDITOR.prototype = {
* @param {Object} e
*/
stop_touch_scroll: function(e) {
e.stopPropagation();
e.preventDefault();
var drawingregion = this.get_dialogue_element(SELECTOR.DRAWINGREGION);
if (drawingregion.contains(e.target)) {
e.stopPropagation();
e.preventDefault();
}
}
};