mirror of
https://github.com/jquery/jquery.git
synced 2024-10-05 11:34:18 +00:00
Refactor code in effects to use data_priv. Re- Close gh-1244.
This commit is contained in:
parent
039371c741
commit
5179fa00b8
11
src/effects.js
vendored
11
src/effects.js
vendored
@ -304,7 +304,7 @@ function defaultPrefilter( elem, props, opts ) {
|
|||||||
|
|
||||||
|
|
||||||
// show/hide pass
|
// show/hide pass
|
||||||
dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
|
dataShow = data_priv.get( elem, "fxshow" );
|
||||||
for ( index in props ) {
|
for ( index in props ) {
|
||||||
value = props[ index ];
|
value = props[ index ];
|
||||||
if ( rfxtypes.exec( value ) ) {
|
if ( rfxtypes.exec( value ) ) {
|
||||||
@ -313,20 +313,19 @@ function defaultPrefilter( elem, props, opts ) {
|
|||||||
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 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 ) {
|
if( value === "show" && dataShow !== undefined && dataShow[ index ] !== undefined ) {
|
||||||
hidden = true;
|
hidden = true;
|
||||||
} else {
|
} 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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user