Browse files

Check for existence of el before adding/removing hover className. Fix…

…es error in situation where the element is destroyed in between a mouseenter/mouseleave event and the execution of the 0ms setTimeout. Bug and fix submitted by David Herman. http://css3pie.com/forum/viewtopic.php?f=3&t=320
  • Loading branch information...
1 parent c9a03fc commit 8a9171d6f85564c331397a7854827b25834771ec Jason Johnston committed Dec 14, 2010
Showing with 6 additions and 2 deletions.
  1. +6 −2 sources/Element.js
View
8 sources/Element.js
@@ -208,11 +208,15 @@ PIE.Element = (function() {
function addHoverClass() {
- el.className += hoverClass;
+ if( el ) {
+ el.className += hoverClass;
+ }
}
function removeHoverClass() {
- el.className = el.className.replace( hoverClassRE, '' );
+ if( el ) {
+ el.className = el.className.replace( hoverClassRE, '' );
+ }
}
/**

0 comments on commit 8a9171d

Please sign in to comment.