diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2012-01-28 16:46:52 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2012-01-28 16:46:52 -0500 |
commit | c746f79cc024df41d9300f3b910a8a55b3c91c3e (patch) | |
tree | e4a3c97b71f0095ee39e7d924e0d3f963f1cf0e2 /test/delegatetest.html | |
parent | 633ca9c1610c49dbb780e565f4f1202e1fe20fae (diff) | |
download | jquery-c746f79cc024df41d9300f3b910a8a55b3c91c3e.tar.gz jquery-c746f79cc024df41d9300f3b910a8a55b3c91c3e.zip |
Fix #10878. Clear oldIE special change/submit flags on a clone.
Diffstat (limited to 'test/delegatetest.html')
-rw-r--r-- | test/delegatetest.html | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/test/delegatetest.html b/test/delegatetest.html index 012d27c91..a291763b2 100644 --- a/test/delegatetest.html +++ b/test/delegatetest.html @@ -143,7 +143,7 @@ $(function(){ }); // Events we want to track in row-order -var events = "bind-change live-change on-change bind-propertychange live-beforeactivate live-focusin bind-focus live-beforedeactivate live-focusout bind-blur live-click live-keydown".split(" "), +var events = "bind-change live-change onX-change bind-propertychange live-beforeactivate live-focusin bind-focus live-beforedeactivate live-focusout bind-blur live-click live-keydown".split(" "), counter = 0; blinker = function(event){ if ( !counter ) { @@ -172,7 +172,7 @@ for ( var i=0; i < events.length; i++ ) { $("#changes thead td").each(function(){ var id = "#"+this.id, $cell = $('<td></td>'); - if ( api == "on" ) { + if ( api == "onX" ) { $(this).find("input, button, select, textarea").each(function(){ this["on"+type] = function(e){ e = $.event.fix(e||event); e.data = $cell; blinker.call(this, e); }; }); @@ -186,6 +186,16 @@ for ( var i=0; i < events.length; i++ ) { $("#changes tbody").append($row); } +// Ensure that cloned elements get the delegated event magic; this is +// implementation-specific knowledge but otherwise impossible to test. +// The beforeactivate event attaches a direct-bound change event. +// (Only care about the live change for this third select element.) +var sel1 = $("#select-one select:first-child"); +if ( typeof(sel1[0].fireEvent) !== "undefined" ) { + sel1.trigger( "beforeactivate" ).clone().appendTo("#select-one"); + //alert($("#select-one select").map(function(){ return this._change_attached || "undef"; }).get().join("|")); +} + jQuery.fn.blink = function(){ return this .css("backgroundColor","green") |