Browse Source

Pull request #230370: KERNEL-14365 refactor(tracker): 多暴露个event对象

Merge in DEC/fineui from ~XAVIER.MENG/dec-fineui:release/11.0 to release/11.0

* commit 'de0c11ced924d06bc54b7ef885818ac3e455c548':
  KERNEL-14365 refactor(tracker): 多暴露个event对象
research/test
Xavier.Meng-孟宇翔 2 years ago
parent
commit
c849674bbe
  1. 12
      src/core/utils/events/mousemovetracker.js

12
src/core/utils/events/mousemovetracker.js

@ -82,7 +82,7 @@
// The mouse may move faster then the animation frame does.
// Use `requestAnimationFrame` to avoid over-updating.
this._animationFrameID =
requestAnimationFrame(this._didMouseMove);
requestAnimationFrame(() => this._didMouseMove(event));
}
this._x = x;
@ -90,18 +90,18 @@
event.preventDefault ? event.preventDefault() : (event.returnValue = false);
},
_didMouseMove: function () {
_didMouseMove: function (event) {
this._animationFrameID = null;
this._onMove(this._deltaX, this._deltaY);
this._onMove(this._deltaX, this._deltaY, event);
this._deltaX = 0;
this._deltaY = 0;
},
_onMouseUp: function () {
_onMouseUp: function (event) {
if (this._animationFrameID) {
this._didMouseMove();
this._didMouseMove(event);
}
this._onMoveEnd();
this._onMoveEnd(event);
}
};
})();

Loading…
Cancel
Save