]> source.dussan.org Git - jquery.git/commitdiff
Refactor code in effects to use data_priv. Re- Close gh-1244.
authorros3cin <ros3@cin.ufpe.br>
Wed, 17 Apr 2013 07:06:12 +0000 (04:06 -0300)
committerDave Methvin <dave.methvin@gmail.com>
Wed, 17 Apr 2013 16:37:23 +0000 (12:37 -0400)
src/effects.js

index a1ba377074d31548d30ea0cab3abe111fc7bfc00..6f86856993436bf2246eef2e4d7149ada086634f 100644 (file)
@@ -304,7 +304,7 @@ function defaultPrefilter( elem, props, opts ) {
 
 
        // show/hide pass
-       dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
+       dataShow = data_priv.get( elem, "fxshow" );
        for ( index in props ) {
                value = props[ index ];
                if ( rfxtypes.exec( value ) ) {
@@ -313,20 +313,19 @@ function defaultPrefilter( elem, props, opts ) {
                        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 ) {
+                               if( value === "show" && dataShow !== undefined && dataShow[ index ] !== undefined ) {
                                        hidden = true;
                                } else {
-                               continue;
-                       }
+                                       continue;
+                               }
                        }
                        handled.push( index );
                }
        }
 
        length = handled.length;
-       if ( !length ) {
+       if ( length ) {
                dataShow = data_priv.get( elem, "fxshow" ) || data_priv.access( elem, "fxshow", {} );
-       } else {
                if ( "hidden" in dataShow ) {
                        hidden = dataShow.hidden;
                }