Permalink
Browse files

test currentTarget in event delegation scenario

  • Loading branch information...
1 parent 4a2f5e4 commit f146537d0925f37a71030198ddf9b779e448ec71 @mislav mislav committed Oct 2, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 test/event.html
View
@@ -134,14 +134,16 @@
},
testDelegateEventProperties: function(t){
- var type, target
+ var type, target, currentTarget
$(document).on('click', 'div', function(e){
type = e.type
target = e.target
+ currentTarget = e.currentTarget
})
- click(this.el)
+ click($('<span>').appendTo(this.el))
t.assertEqual('click', type)
- t.assertIdentical(this.el.get(0), target)
+ t.assertIdentical(this.el.find('span').get(0), target)
+ t.assertIdentical(this.el.get(0), currentTarget)
}
})
})()

0 comments on commit f146537

Please sign in to comment.