Bug Tracker

Changeset 4251 for trunk/jquery/test

Show
Ignore:
Timestamp:
12/20/07 13:36:56 (1 year ago)
Author:
jeresig
Message:

Fixed #2027 - make sure that cloned elements (within appendTo, etc.) have their events cloned by default.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/jquery/test/unit/event.js

    r4246 r4251  
    22 
    33test("bind()", function() { 
    4     expect(18); 
     4    expect(19); 
    55 
    66    var handler = function(event) { 
     
    8686        equals(this.nodeType, 1, "Check node,textnode,comment bind just does real nodes" ); 
    8787    }).trigger("tester"); 
     88 
     89    // Make sure events stick with appendTo'd elements (which are cloned) #2027 
     90    $("<a href='#fail' class='test'>test</a>").click(function(){ return false; }).appendTo("p"); 
     91    ok( $("a.test:first").triggerHandler("click") === false, "Handler is bound to appendTo'd elements" ); 
     92    reset(); 
    8893}); 
    8994