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
0a099048
Commit
0a099048
authored
Nov 16, 2007
by
David Serduke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed #1822 bug where queue() didn't always default to type 'fx'.
parent
1d299d37
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
fx.js
src/fx.js
+3
-1
fx.js
test/unit/fx.js
+18
-1
No files found.
src/fx.js
View file @
0a099048
...
@@ -126,7 +126,7 @@ jQuery.fn.extend({
...
@@ -126,7 +126,7 @@ jQuery.fn.extend({
},
},
queue
:
function
(
type
,
fn
){
queue
:
function
(
type
,
fn
){
if
(
jQuery
.
isFunction
(
type
)
)
{
if
(
jQuery
.
isFunction
(
type
)
||
(
type
&&
type
.
constructor
==
Array
)
)
{
fn
=
type
;
fn
=
type
;
type
=
"fx"
;
type
=
"fx"
;
}
}
...
@@ -162,6 +162,8 @@ var queue = function( elem, type, array ) {
...
@@ -162,6 +162,8 @@ var queue = function( elem, type, array ) {
if
(
!
elem
)
if
(
!
elem
)
return
;
return
;
type
=
type
||
"fx"
;
var
q
=
jQuery
.
data
(
elem
,
type
+
"queue"
);
var
q
=
jQuery
.
data
(
elem
,
type
+
"queue"
);
if
(
!
q
||
array
)
if
(
!
q
||
array
)
...
...
test/unit/fx.js
View file @
0a099048
...
@@ -29,11 +29,28 @@ test("animate option (queue === false)", function () {
...
@@ -29,11 +29,28 @@ test("animate option (queue === false)", function () {
$foo
.
animate
({
height
:
'100px'
},
10
,
function
()
{
$foo
.
animate
({
height
:
'100px'
},
10
,
function
()
{
// queued behind the first animation so should finish third
// queued behind the first animation so should finish third
order
.
push
(
3
);
order
.
push
(
3
);
isSet
(
order
,
[
1
,
2
,
3
]
);
isSet
(
order
,
[
1
,
2
,
3
]
,
"Animations finished in the correct order"
);
start
();
start
();
});
});
});
});
test
(
"queue() defaults to 'fx' type"
,
function
()
{
expect
(
2
);
stop
();
var
$foo
=
$
(
"#foo"
);
$foo
.
queue
(
"fx"
,
[
"sample"
,
"array"
]);
var
arr
=
$foo
.
queue
();
isSet
(
arr
,
[
"sample"
,
"array"
],
"queue() got an array set with type 'fx'"
);
$foo
.
queue
([
"another"
,
"one"
]);
var
arr
=
$foo
.
queue
(
"fx"
);
isSet
(
arr
,
[
"another"
,
"one"
],
"queue('fx') got an array set with no type"
);
// clean up after test
$foo
.
queue
([]);
start
();
});
test
(
"stop()"
,
function
()
{
test
(
"stop()"
,
function
()
{
expect
(
3
);
expect
(
3
);
stop
();
stop
();
...
...
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