@@ -762,7 +762,7 @@ if (!window.af || typeof(af) !== "function") {
762
762
if ( this . length === 0 )
763
763
return ( value === nundefined ) ? undefined : this ;
764
764
if ( value === nundefined && ! $ . isObject ( attr ) ) {
765
- var val = ( this [ 0 ] . afmCacheId && _attrCache [ this [ 0 ] . afmCacheId ] [ attr ] ) ? ( this [ 0 ] . afmCacheId && _attrCache [ this [ 0 ] . afmCacheId ] [ attr ] ) : this [ 0 ] . getAttribute ( attr ) ;
765
+ var val = ( this [ 0 ] . afmCacheId && _attrCache [ this [ 0 ] . afmCacheId ] && _attrCache [ this [ 0 ] . afmCacheId ] [ attr ] ) ? _attrCache [ this [ 0 ] . afmCacheId ] [ attr ] : this [ 0 ] . getAttribute ( attr ) ;
766
766
return val ;
767
767
}
768
768
for ( var i = 0 ; i < this . length ; i ++ ) {
@@ -784,6 +784,8 @@ if (!window.af || typeof(af) !== "function") {
784
784
delete _attrCache [ this [ i ] . afmCacheId ] [ attr ] ;
785
785
} else {
786
786
this [ i ] . setAttribute ( attr , value ) ;
787
+ if ( this [ i ] . afmCacheId && _attrCache [ this [ i ] . afmCacheId ] [ attr ] )
788
+ delete _attrCache [ this [ i ] . afmCacheId ] [ attr ] ;
787
789
}
788
790
}
789
791
return this ;
@@ -801,7 +803,7 @@ if (!window.af || typeof(af) !== "function") {
801
803
removeAttr : function ( attr ) {
802
804
var removeFixer = function ( param ) {
803
805
that [ i ] . removeAttribute ( param ) ;
804
- if ( that [ i ] . afmCacheId && _attrCache [ that [ i ] . afmCacheId ] [ attr ] )
806
+ if ( that [ i ] . afmCacheId && _attrCache [ that [ i ] . afmCacheId ] )
805
807
delete _attrCache [ that [ i ] . afmCacheId ] [ attr ] ;
806
808
} ;
807
809
var that = this ;
@@ -829,8 +831,8 @@ if (!window.af || typeof(af) !== "function") {
829
831
if ( this . length === 0 )
830
832
return ( value === nundefined ) ? undefined : this ;
831
833
if ( value === nundefined && ! $ . isObject ( prop ) ) {
832
- var res ;
833
- var val = ( this [ 0 ] . afmCacheId && _propCache [ this [ 0 ] . afmCacheId ] [ prop ] ) ? ( this [ 0 ] . afmCacheId && _propCache [ this [ 0 ] . afmCacheId ] [ prop ] ) : ! ( res = this [ 0 ] [ prop ] ) && prop in this [ 0 ] ? this [ 0 ] [ prop ] : res ;
834
+ var res ;
835
+ var val = ( this [ 0 ] . afmCacheId && _propCache [ this [ 0 ] . afmCacheId ] && _propCache [ this [ 0 ] . afmCacheId ] [ prop ] ) ? _propCache [ this [ 0 ] . afmCacheId ] [ prop ] : ! ( res = this [ 0 ] [ prop ] ) && prop in this [ 0 ] ? this [ 0 ] [ prop ] : res ;
834
836
return val ;
835
837
}
836
838
for ( var i = 0 ; i < this . length ; i ++ ) {
@@ -839,7 +841,6 @@ if (!window.af || typeof(af) !== "function") {
839
841
$ ( this [ i ] ) . prop ( key , prop [ key ] ) ;
840
842
}
841
843
} else if ( $ . isArray ( value ) || $ . isObject ( value ) || $ . isFunction ( value ) ) {
842
-
843
844
if ( ! this [ i ] . afmCacheId )
844
845
this [ i ] . afmCacheId = $ . uuid ( ) ;
845
846
@@ -849,6 +850,8 @@ if (!window.af || typeof(af) !== "function") {
849
850
} else if ( value === null && value !== undefined ) {
850
851
$ ( this [ i ] ) . removeProp ( prop ) ;
851
852
} else {
853
+ if ( _propCache [ this [ i ] . afmCacheId ] [ prop ] )
854
+ _propCache [ this [ i ] . afmCacheId ] [ prop ] = null ;
852
855
this [ i ] [ prop ] = value ;
853
856
}
854
857
}
@@ -868,7 +871,7 @@ if (!window.af || typeof(af) !== "function") {
868
871
var removePropFn = function ( param ) {
869
872
if ( that [ i ] [ param ] )
870
873
that [ i ] [ param ] = undefined ;
871
- if ( that [ i ] . afmCacheId && _propCache [ that [ i ] . afmCacheId ] [ prop ] ) {
874
+ if ( that [ i ] . afmCacheId && _propCache [ that [ i ] . afmCacheId ] ) {
872
875
delete _propCache [ that [ i ] . afmCacheId ] [ prop ] ;
873
876
}
874
877
} ;
0 commit comments