File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 7
7
8
8
9
9
( function ( global , doc , factoryFn ) {
10
- var factory = factoryFn ( ) ;
10
+ //初始化toucher主方法
11
+ var factory = factoryFn ( global , doc ) ;
12
+
11
13
//提供window.util.toucher()接口
12
14
global . util = global . util || { } ;
13
15
global . util . toucher = global . util . toucher || factory ;
16
+
14
17
//提供CommonJS规范的接口
15
18
global . define && define ( function ( require , exports , module ) {
16
19
//对外接口
17
20
return factory ;
18
21
} ) ;
19
- } ) ( this , document , function ( ) {
22
+ } ) ( this , document , function ( window , document ) {
20
23
/**
21
24
* 判断是否拥有某个class
22
25
*/
138
141
139
142
var newE = {
140
143
'type' : name ,
144
+ 'target' : e . target ,
141
145
'pageX' : touch . clientX || 0 ,
142
146
'pageY' : touch . clientY || 0
143
147
} ;
174
178
175
179
//轻击开始时间
176
180
var touchStartTime = 0 ;
181
+
177
182
//记录上一次点击时间
178
183
var lastTouchTime = 0 ;
184
+
179
185
//记录初始轻击的位置
180
186
var x1 , y1 , x2 , y2 ;
187
+
181
188
//轻击事件的延时器
182
189
var touchDelay ;
190
+
183
191
//测试长按事件的延时器
184
192
var longTap ;
193
+
185
194
//记录当前事件是否已为等待结束的状态
186
195
var isActive = false ;
187
196
//记录有坐标信息的事件
You can’t perform that action at this time.
0 commit comments