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
ea5c22ec
Commit
ea5c22ec
authored
Mar 17, 2013
by
Renato Oliveira dos Santos
Committed by
Dave Methvin
Apr 17, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #13483. Let slideDown() work after stop(). Close gh-1205.
parent
2c7b1b85
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
1 deletion
+70
-1
AUTHORS.txt
AUTHORS.txt
+1
-0
effects.js
src/effects.js
+9
-1
effects.js
test/unit/effects.js
+60
-0
No files found.
AUTHORS.txt
View file @
ea5c22ec
...
@@ -166,3 +166,4 @@ Dmitry Gusev <dmitry.gusev@gmail.com>
...
@@ -166,3 +166,4 @@ Dmitry Gusev <dmitry.gusev@gmail.com>
Michał Gołębiowski <m.goleb@gmail.com>
Michał Gołębiowski <m.goleb@gmail.com>
Steven Benner <admin@stevenbenner.com>
Steven Benner <admin@stevenbenner.com>
Li Xudong <istonelee@gmail.com>
Li Xudong <istonelee@gmail.com>
Renato Oliveira dos Santos <ros3@cin.ufpe.br>
src/effects.js
View file @
ea5c22ec
...
@@ -304,21 +304,29 @@ function defaultPrefilter( elem, props, opts ) {
...
@@ -304,21 +304,29 @@ function defaultPrefilter( elem, props, opts ) {
// show/hide pass
// show/hide pass
dataShow
=
jQuery
.
_data
(
elem
,
"fxshow"
)
||
jQuery
.
_data
(
elem
,
"fxshow"
,
{}
);
for
(
index
in
props
)
{
for
(
index
in
props
)
{
value
=
props
[
index
];
value
=
props
[
index
];
if
(
rfxtypes
.
exec
(
value
)
)
{
if
(
rfxtypes
.
exec
(
value
)
)
{
delete
props
[
index
];
delete
props
[
index
];
toggle
=
toggle
||
value
===
"toggle"
;
toggle
=
toggle
||
value
===
"toggle"
;
if
(
value
===
(
hidden
?
"hide"
:
"show"
)
)
{
if
(
value
===
(
hidden
?
"hide"
:
"show"
)
)
{
// If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
if
(
value
===
"show"
&&
dataShow
[
index
]
!==
undefined
)
{
hidden
=
true
;
}
else
{
continue
;
continue
;
}
}
}
handled
.
push
(
index
);
handled
.
push
(
index
);
}
}
}
}
length
=
handled
.
length
;
length
=
handled
.
length
;
if
(
length
)
{
if
(
!
length
)
{
dataShow
=
data_priv
.
get
(
elem
,
"fxshow"
)
||
data_priv
.
access
(
elem
,
"fxshow"
,
{}
);
dataShow
=
data_priv
.
get
(
elem
,
"fxshow"
)
||
data_priv
.
access
(
elem
,
"fxshow"
,
{}
);
}
else
{
if
(
"hidden"
in
dataShow
)
{
if
(
"hidden"
in
dataShow
)
{
hidden
=
dataShow
.
hidden
;
hidden
=
dataShow
.
hidden
;
}
}
...
...
test/unit/effects.js
View file @
ea5c22ec
...
@@ -2033,4 +2033,64 @@ test( ".finish() calls finish of custom queue functions", function() {
...
@@ -2033,4 +2033,64 @@ test( ".finish() calls finish of custom queue functions", function() {
div
.
remove
();
div
.
remove
();
});
});
asyncTest
(
"slideDown() after stop() (#13483)"
,
2
,
function
()
{
var
ul
=
jQuery
(
"<ul style='height: 100px;display: block'></ul>"
),
origHeight
=
ul
.
height
();
// First test. slideUp() -> stop() in the middle -> slideDown() until the end
ul
.
slideUp
(
1000
);
setTimeout
(
function
()
{
ul
.
stop
(
true
);
ul
.
slideDown
(
1
,
function
()
{
equal
(
ul
.
height
(),
origHeight
,
"slideDown() after interrupting slideUp() with stop(). Height must be in original value"
);
// Second test. slideDown() -> stop() in the middle -> slideDown() until the end
ul
.
slideUp
(
1
,
function
()
{
ul
.
slideDown
(
1000
);
setTimeout
(
function
()
{
ul
.
stop
(
true
);
ul
.
slideDown
(
1
,
function
()
{
equal
(
ul
.
height
(),
origHeight
,
"slideDown() after interrupting slideDown() with stop(). Height must be in original value"
);
// Cleanup
ul
.
remove
();
start
();
});
},
500
);
});
});
},
500
);
});
asyncTest
(
"fadeIn() after stop() (related to #13483)"
,
2
,
function
()
{
var
ul
=
jQuery
(
"<ul style='height: 100px;display: block; opacity: 1'></ul>"
),
origOpacity
=
ul
.
css
(
"opacity"
);
// First test. fadeOut() -> stop() in the middle -> fadeIn() until the end
ul
.
fadeOut
(
1000
);
setTimeout
(
function
()
{
ul
.
stop
(
true
);
ul
.
fadeIn
(
1
,
function
()
{
equal
(
ul
.
css
(
"opacity"
),
origOpacity
,
"fadeIn() after interrupting fadeOut() with stop(). Opacity must be in original value"
);
// Second test. fadeIn() -> stop() in the middle -> fadeIn() until the end
ul
.
fadeOut
(
1
,
function
()
{
ul
.
fadeIn
(
1000
);
setTimeout
(
function
()
{
ul
.
stop
(
true
);
ul
.
fadeIn
(
1
,
function
()
{
equal
(
ul
.
css
(
"opacity"
),
origOpacity
,
"fadeIn() after interrupting fadeIn() with stop(). Opacity must be in original value"
);
// Cleanup
ul
.
remove
();
start
();
});
},
500
);
});
});
},
500
);
});
})();
})();
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