From: Brandon Aaron Date: Fri, 23 Feb 2007 04:47:24 +0000 (+0000) Subject: Fix for #921 X-Git-Url: http://git.asbjorn.biz/?a=commitdiff_plain;h=7820594c6630c0018a60e1c9c7bcacf78de06fb4;p=jquery.git Fix for #921 --- diff --git a/ChangeLog.txt b/ChangeLog.txt index ba4ed5f..55d38e5 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,6 +7,7 @@ New and Noteworthy 1.1.2 ---- +* Fixed an issue in IE where an event on a cloned element is fired during a .clone() inside of an event handler. * Fixed IE ID selectors selecting by the name attribute. * Change: Events are now internally stored in elem.$events rather than elem.events (due to a nasty bug relating to DOM 0 expandos). * .attr('href') is now consistent in all browsers. diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index e1840a6..c309428 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -824,7 +824,9 @@ jQuery.fn = jQuery.prototype = { */ clone: function(deep) { return this.pushStack( jQuery.map( this, function(a){ - return a.cloneNode( deep != undefined ? deep : true ); + var a = a.cloneNode( deep != undefined ? deep : true ); + a.$events = null; // drop $events expando to avoid firing incorrect events + return a; }) ); },