Permalink
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 fe693ae commit 4f092d9654c731b798e76dbcdcad5333751be745 Jason Johnston committed with ziggythehamster Dec 15, 2010
Showing with 6 additions and 2 deletions.
  1. +6 −2 sources/Element.js
View
@@ -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 4f092d9

Please sign in to comment.