Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fastclick
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
easyUI
fastclick
Commits
5deeaaf0
Commit
5deeaaf0
authored
Jun 05, 2019
by
Nature
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fastClick长按事件
parent
fb6005f8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
fastclick.js
lib/fastclick.js
+10
-2
No files found.
lib/fastclick.js
View file @
5deeaaf0
...
@@ -534,7 +534,7 @@
...
@@ -534,7 +534,7 @@
* @returns {boolean}
* @returns {boolean}
*/
*/
FastClick
.
prototype
.
onTouchEnd
=
function
(
event
)
{
FastClick
.
prototype
.
onTouchEnd
=
function
(
event
)
{
var
forElement
,
trackingClickStart
,
targetTagName
,
scrollParent
,
touch
,
targetElement
=
this
.
targetElement
var
forElement
,
trackingClickStart
,
targetTagName
,
scrollParent
,
touch
,
pointY
,
targetElement
=
this
.
targetElement
if
(
!
this
.
trackingClick
)
{
if
(
!
this
.
trackingClick
)
{
return
true
return
true
}
}
...
@@ -545,7 +545,15 @@
...
@@ -545,7 +545,15 @@
return
true
return
true
}
}
/**
* 页面长按添加键盘监听事件
*/
if
((
event
.
timeStamp
-
this
.
trackingClickStart
)
>
this
.
tapTimeout
)
{
if
((
event
.
timeStamp
-
this
.
trackingClickStart
)
>
this
.
tapTimeout
)
{
if
(
targetElement
.
readOnly
)
return
if
(
targetElement
.
nodeName
===
'INPUT'
||
targetElement
.
nodeName
===
'TEXTAREA'
)
{
pointY
=
event
.
changedTouches
[
0
].
clientY
;
scollContent
(
pointY
,
targetElement
)
}
return
true
return
true
}
}
...
@@ -569,7 +577,7 @@
...
@@ -569,7 +577,7 @@
targetElement
=
document
.
elementFromPoint
(
touch
.
pageX
-
window
.
pageXOffset
,
touch
.
pageY
-
window
.
pageYOffset
)
||
targetElement
targetElement
=
document
.
elementFromPoint
(
touch
.
pageX
-
window
.
pageXOffset
,
touch
.
pageY
-
window
.
pageYOffset
)
||
targetElement
targetElement
.
fastClickScrollParent
=
this
.
targetElement
.
fastClickScrollParent
targetElement
.
fastClickScrollParent
=
this
.
targetElement
.
fastClickScrollParent
}
}
var
pointY
=
touch
=
event
.
changedTouches
[
0
].
page
Y
;
pointY
=
event
.
changedTouches
[
0
].
client
Y
;
targetTagName
=
targetElement
.
tagName
.
toLowerCase
()
targetTagName
=
targetElement
.
tagName
.
toLowerCase
()
if
(
targetTagName
===
'label'
)
{
if
(
targetTagName
===
'label'
)
{
forElement
=
this
.
findControl
(
targetElement
)
forElement
=
this
.
findControl
(
targetElement
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment