Skip to content

Commit

Permalink
Make sure the element still exists after the add/removeClass delay. F…
Browse files Browse the repository at this point in the history
…ixes lojjic#191.
  • Loading branch information
Jason Johnston committed Dec 31, 2011
1 parent 775ce0a commit 0c0087f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sources/Element.js
Expand Up @@ -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 );
}
Expand All @@ -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 );
}
Expand Down

0 comments on commit 0c0087f

Please sign in to comment.