Skip to content

Commit

Permalink
Fix touch move on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
100pah committed Mar 23, 2017
1 parent ad5ca44 commit 3b955ba
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/component/dataZoom/SliderZoomView.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ define(function (require) {
var linearMap = numberUtil.linearMap;
var layout = require('../../util/layout');
var sliderMove = require('../helper/sliderMove');
var eventTool = require('zrender/core/event');

var asc = numberUtil.asc;
var bind = zrUtil.bind;
// var mathMax = Math.max;
Expand Down Expand Up @@ -415,6 +417,10 @@ define(function (require) {
draggable: true,
cursor: 'move',
drift: bind(this._onDragMove, this, 'all'),
onmousemove: function (e) {
// Fot mobile devicem, prevent screen slider on the button.
eventTool.stop(e.event);
},
ondragstart: bind(this._showDataInfo, this, true),
ondragend: bind(this._onDragEnd, this),
onmouseover: bind(this._showDataInfo, this, true),
Expand Down Expand Up @@ -452,6 +458,10 @@ define(function (require) {
cursor: this._orient === 'vertical' ? 'ns-resize' : 'ew-resize',
draggable: true,
drift: bind(this._onDragMove, this, handleIndex),
onmousemove: function (e) {
// Fot mobile devicem, prevent screen slider on the button.
eventTool.stop(e.event);
},
ondragend: bind(this._onDragEnd, this),
onmouseover: bind(this._showDataInfo, this, true),
onmouseout: bind(this._showDataInfo, this, false)
Expand Down
9 changes: 9 additions & 0 deletions src/component/visualMap/ContinuousView.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ define(function(require) {
var LinearGradient = require('zrender/graphic/LinearGradient');
var helper = require('./helper');
var modelUtil = require('../../util/model');
var eventTool = require('zrender/core/event');

var linearMap = numberUtil.linearMap;
var each = zrUtil.each;
Expand Down Expand Up @@ -230,6 +231,10 @@ define(function(require) {
var handleLabel = new graphic.Text({
draggable: true,
drift: onDrift,
onmousemove: function (e) {
// Fot mobile devicem, prevent screen slider on the button.
eventTool.stop(e.event);
},
ondragend: onDragEnd,
style: {
x: 0, y: 0, text: '',
Expand Down Expand Up @@ -794,6 +799,10 @@ define(function(require) {
draggable: !!onDrift,
cursor: cursor,
drift: onDrift,
onmousemove: function (e) {
// Fot mobile devicem, prevent screen slider on the button.
eventTool.stop(e.event);
},
ondragend: onDragEnd
});
}
Expand Down

0 comments on commit 3b955ba

Please sign in to comment.