Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
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
夏彬
jquery
Commits
f5f6cbc8
Commit
f5f6cbc8
authored
Jul 16, 2006
by
John Resig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issues with oneEvent events.
parent
7d57c677
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
event.js
event/event.js
+11
-10
No files found.
event/event.js
View file @
f5f6cbc8
...
@@ -120,17 +120,18 @@ new function(){
...
@@ -120,17 +120,18 @@ new function(){
// Finally, handle events that only fire once
// Finally, handle events that only fire once
jQuery
.
fn
[
"one"
+
o
]
=
function
(
f
){
jQuery
.
fn
[
"one"
+
o
]
=
function
(
f
){
// Attach the event listener
// Attach the event listener
return
this
.
bind
(
o
,
function
(
e
){
return
this
.
each
(
function
(
){
// TODO: Remove the event listener, instead of this hack
var
count
=
0
;
// If this function has already been executed, stop
if
(
this
[
o
+
f
]
!==
null
)
return
;
// Add the event
jQuery
.
event
.
add
(
this
,
o
,
function
(
e
){
// Otherwise, mark as having been executed
// If this function has already been executed, stop
this
[
o
+
f
]
++
;
if
(
count
++
)
return
;
// And execute the bound function
// And execute the bound function
return
f
.
apply
(
this
,
[
e
]);
return
f
.
apply
(
this
,
[
e
]);
});
});
});
};
};
...
...
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