mirror of
https://github.com/genxium/DelayNoMore
synced 2025-10-09 16:46:38 +00:00
Initial commit.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var MouseEvent = function MouseEvent() {
|
||||
_classCallCheck(this, MouseEvent);
|
||||
};
|
||||
|
||||
exports.default = MouseEvent;
|
||||
module.exports = exports["default"];
|
@@ -0,0 +1,45 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = undefined;
|
||||
|
||||
var _index = require('../util/index.js');
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
|
||||
var TouchEvent = function TouchEvent(type) {
|
||||
_classCallCheck(this, TouchEvent);
|
||||
|
||||
this.touches = [];
|
||||
this.targetTouches = [];
|
||||
this.changedTouches = [];
|
||||
this.preventDefault = _index.noop;
|
||||
this.stopPropagation = _index.noop;
|
||||
|
||||
this.type = type;
|
||||
this.target = window.canvas;
|
||||
this.currentTarget = window.canvas;
|
||||
};
|
||||
|
||||
exports.default = TouchEvent;
|
||||
|
||||
|
||||
function touchEventHandlerFactory(type) {
|
||||
return function (event) {
|
||||
var touchEvent = new TouchEvent(type);
|
||||
|
||||
touchEvent.touches = event.touches;
|
||||
touchEvent.targetTouches = Array.prototype.slice.call(event.touches);
|
||||
touchEvent.changedTouches = event.changedTouches;
|
||||
touchEvent.timeStamp = event.timeStamp;
|
||||
document.dispatchEvent(touchEvent);
|
||||
};
|
||||
}
|
||||
|
||||
wx.onTouchStart(touchEventHandlerFactory('touchstart'));
|
||||
wx.onTouchMove(touchEventHandlerFactory('touchmove'));
|
||||
wx.onTouchEnd(touchEventHandlerFactory('touchend'));
|
||||
wx.onTouchCancel(touchEventHandlerFactory('touchcancel'));
|
||||
module.exports = exports['default'];
|
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.MouseEvent = exports.TouchEvent = undefined;
|
||||
|
||||
var _TouchEvent2 = require('./TouchEvent');
|
||||
|
||||
var _TouchEvent3 = _interopRequireDefault(_TouchEvent2);
|
||||
|
||||
var _MouseEvent2 = require('./MouseEvent');
|
||||
|
||||
var _MouseEvent3 = _interopRequireDefault(_MouseEvent2);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
exports.TouchEvent = _TouchEvent3.default;
|
||||
exports.MouseEvent = _MouseEvent3.default;
|
Reference in New Issue
Block a user