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
0d5bd174
Commit
0d5bd174
authored
Dec 21, 2009
by
jeresig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved logic for handling .animate({}), doesn't queue anymore. Fixes #5459.
parent
f0505c6d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
effects.js
src/effects.js
+4
-4
effects.js
test/unit/effects.js
+11
-1
No files found.
src/effects.js
View file @
0d5bd174
...
@@ -108,6 +108,10 @@ jQuery.fn.extend({
...
@@ -108,6 +108,10 @@ jQuery.fn.extend({
animate
:
function
(
prop
,
speed
,
easing
,
callback
)
{
animate
:
function
(
prop
,
speed
,
easing
,
callback
)
{
var
optall
=
jQuery
.
speed
(
speed
,
easing
,
callback
);
var
optall
=
jQuery
.
speed
(
speed
,
easing
,
callback
);
if
(
jQuery
.
isEmptyObject
(
prop
)
)
{
return
this
.
each
(
optall
.
complete
);
}
return
this
[
optall
.
queue
===
false
?
"each"
:
"queue"
](
function
()
{
return
this
[
optall
.
queue
===
false
?
"each"
:
"queue"
](
function
()
{
var
opt
=
jQuery
.
extend
({},
optall
),
p
,
var
opt
=
jQuery
.
extend
({},
optall
),
p
,
hidden
=
this
.
nodeType
===
1
&&
jQuery
(
this
).
is
(
":hidden"
),
hidden
=
this
.
nodeType
===
1
&&
jQuery
(
this
).
is
(
":hidden"
),
...
@@ -181,10 +185,6 @@ jQuery.fn.extend({
...
@@ -181,10 +185,6 @@ jQuery.fn.extend({
}
}
});
});
if
(
jQuery
.
isEmptyObject
(
prop
)
)
{
return
optall
.
complete
.
call
(
this
);
}
// For JS strict compliance
// For JS strict compliance
return
true
;
return
true
;
});
});
...
...
test/unit/effects.js
View file @
0d5bd174
...
@@ -120,7 +120,7 @@ test("animate option (queue === false)", function () {
...
@@ -120,7 +120,7 @@ test("animate option (queue === false)", function () {
*/
*/
test
(
"animate with no properties"
,
function
()
{
test
(
"animate with no properties"
,
function
()
{
expect
(
1
);
expect
(
2
);
var
divs
=
jQuery
(
"div"
),
count
=
0
;
var
divs
=
jQuery
(
"div"
),
count
=
0
;
...
@@ -129,6 +129,16 @@ test("animate with no properties", function() {
...
@@ -129,6 +129,16 @@ test("animate with no properties", function() {
});
});
equals
(
divs
.
length
,
count
,
"Make sure that callback is called for each element in the set."
);
equals
(
divs
.
length
,
count
,
"Make sure that callback is called for each element in the set."
);
stop
();
var
foo
=
jQuery
(
"#foo"
);
foo
.
animate
({});
foo
.
animate
({
top
:
10
},
100
,
function
(){
ok
(
true
,
"Animation was properly dequeued."
);
start
();
});
});
});
test
(
"animate duration 0"
,
function
()
{
test
(
"animate duration 0"
,
function
()
{
...
...
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