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
321267dc
Commit
321267dc
authored
Sep 15, 2009
by
Ariel Flesler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jquery fx: closes #2542. show/hide(0, fn) wasn't calling the callback.
parent
5e0da8c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
fx.js
src/fx.js
+2
-2
fx.js
test/unit/fx.js
+10
-2
No files found.
src/fx.js
View file @
321267dc
...
...
@@ -19,7 +19,7 @@ function genFx( type, num ){
jQuery
.
fn
.
extend
({
show
:
function
(
speed
,
callback
){
if
(
speed
)
{
if
(
speed
!==
undefined
)
{
return
this
.
animate
(
genFx
(
"show"
,
3
),
speed
,
callback
);
}
else
{
for
(
var
i
=
0
,
l
=
this
.
length
;
i
<
l
;
i
++
){
...
...
@@ -59,7 +59,7 @@ jQuery.fn.extend({
},
hide
:
function
(
speed
,
callback
){
if
(
speed
)
{
if
(
speed
!==
undefined
)
{
return
this
.
animate
(
genFx
(
"hide"
,
3
),
speed
,
callback
);
}
else
{
for
(
var
i
=
0
,
l
=
this
.
length
;
i
<
l
;
i
++
){
...
...
test/unit/fx.js
View file @
321267dc
...
...
@@ -68,7 +68,7 @@ test("animate option (queue === false)", function () {
*/
test
(
"animate duration 0"
,
function
()
{
expect
(
5
);
expect
(
7
);
stop
();
...
...
@@ -97,7 +97,15 @@ test("animate duration 0", function() {
// Failed until [6115]
equals
(
counter
,
5
,
"One synchronic and one asynchronic"
);
start
();
});
});
var
$elem
=
jQuery
(
"<div />"
);
$elem
.
show
(
0
,
function
(){
ok
(
true
,
"Show's callback with no duration"
);
});
$elem
.
hide
(
0
,
function
(){
ok
(
true
,
"Show's callback with no duration"
);
});
});
test
(
"animate hyphenated properties"
,
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