Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make sure the element still exists after the add/removeClass delay. F…

…ixes #191.
  • Loading branch information...
commit 0c0087f154c4dacc1a79420a327d0c2e7f5e2de6 1 parent 775ce0a
Jason Johnston authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 sources/Element.js
12 sources/Element.js
View
@@ -27,8 +27,10 @@ PIE.Element = (function() {
var classes = dummyArray.slice.call( arguments, 1 ),
i = classes.length;
setTimeout( function() {
- while( i-- ) {
- addClass( el, classes[ i ] );
+ if( el ) {
+ while( i-- ) {
+ addClass( el, classes[ i ] );
+ }
}
}, 0 );
}
@@ -37,8 +39,10 @@ PIE.Element = (function() {
var classes = dummyArray.slice.call( arguments, 1 ),
i = classes.length;
setTimeout( function() {
- while( i-- ) {
- removeClass( el, classes[ i ] );
+ if( el ) {
+ while( i-- ) {
+ removeClass( el, classes[ i ] );
+ }
}
}, 0 );
}
Please sign in to comment.
Something went wrong with that request. Please try again.