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
5fc8d9e4
Commit
5fc8d9e4
authored
Apr 28, 2012
by
jaubourg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplifies the way the internal memory storage is handled.
parent
6ad53c33
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
callbacks.js
src/callbacks.js
+8
-9
No files found.
src/callbacks.js
View file @
5fc8d9e4
...
...
@@ -60,7 +60,7 @@ jQuery.Callbacks = function( options ) {
firingIndex
,
// Fire callbacks
fire
=
function
(
data
)
{
memory
=
!
options
.
memory
||
data
;
memory
=
options
.
memory
&&
data
;
fired
=
true
;
firingIndex
=
firingStart
||
0
;
firingStart
=
0
;
...
...
@@ -68,7 +68,7 @@ jQuery.Callbacks = function( options ) {
firing
=
true
;
for
(
;
list
&&
firingIndex
<
firingLength
;
firingIndex
++
)
{
if
(
list
[
firingIndex
].
apply
(
data
[
0
],
data
[
1
]
)
===
false
&&
options
.
stopOnFalse
)
{
memory
=
true
;
// Mark as halte
d
memory
=
false
;
// To prevent further calls using ad
d
break
;
}
}
...
...
@@ -78,10 +78,10 @@ jQuery.Callbacks = function( options ) {
if
(
stack
.
length
)
{
fire
(
stack
.
shift
()
);
}
}
else
if
(
memory
===
true
)
{
self
.
disable
();
}
else
{
}
else
if
(
memory
)
{
list
=
[];
}
else
{
self
.
disable
();
}
}
},
...
...
@@ -107,9 +107,8 @@ jQuery.Callbacks = function( options ) {
if
(
firing
)
{
firingLength
=
list
.
length
;
// With memory, if we're not firing then
// we should call right away, unless previous
// firing was halted (stopOnFalse)
}
else
if
(
memory
&&
memory
!==
true
)
{
// we should call right away
}
else
if
(
memory
)
{
firingStart
=
start
;
fire
(
memory
);
}
...
...
@@ -158,7 +157,7 @@ jQuery.Callbacks = function( options ) {
// Lock the list in its current state
lock
:
function
()
{
stack
=
undefined
;
if
(
!
memory
||
memory
===
true
)
{
if
(
!
memory
)
{
self
.
disable
();
}
return
this
;
...
...
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