aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/event.js
diff options
context:
space:
mode:
authorJohn Resig <jeresig@gmail.com>2007-12-20 13:36:56 +0000
committerJohn Resig <jeresig@gmail.com>2007-12-20 13:36:56 +0000
commit3261544c38ca70cc02c5eed7d0ab2c40c521a588 (patch)
treed6122c608ff124d483830755a46089a6148ed318 /test/unit/event.js
parentb740fe5632b8731a140f16a2f6855910ea6957b9 (diff)
downloadjquery-3261544c38ca70cc02c5eed7d0ab2c40c521a588.tar.gz
jquery-3261544c38ca70cc02c5eed7d0ab2c40c521a588.zip
Fixed #2027 - make sure that cloned elements (within appendTo, etc.) have their events cloned by default.
Diffstat (limited to 'test/unit/event.js')
-rw-r--r--test/unit/event.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/unit/event.js b/test/unit/event.js
index 248094a96..43a4542f0 100644
--- a/test/unit/event.js
+++ b/test/unit/event.js
@@ -1,7 +1,7 @@
module("event");
test("bind()", function() {
- expect(18);
+ expect(19);
var handler = function(event) {
ok( event.data, "bind() with data, check passed data exists" );
@@ -85,6 +85,11 @@ test("bind()", function() {
$("#nonnodes").contents().bind("tester", function () {
equals(this.nodeType, 1, "Check node,textnode,comment bind just does real nodes" );
}).trigger("tester");
+
+ // Make sure events stick with appendTo'd elements (which are cloned) #2027
+ $("<a href='#fail' class='test'>test</a>").click(function(){ return false; }).appendTo("p");
+ ok( $("a.test:first").triggerHandler("click") === false, "Handler is bound to appendTo'd elements" );
+ reset();
});
test("click()", function() {