module("event");
test("bind()", function() {
- expect(15);
+ expect(16);
var handler = function(event) {
ok( event.data, "bind() with data, check passed data exists" );
// Trigger the remaining fn (1)
$("#firstp").trigger("click");
+
+ // using contents will get comments regular, text, and comment nodes
+ $("#nonnodes").contents().bind("tester", function () {
+ equals(this.nodeType, 1, "Check node,textnode,comment bind just does real nodes" );
+ }).trigger("tester");
});
test("click()", function() {
});
test("trigger(event, [data], [fn])", function() {
- expect(66);
+ expect(67);
var handler = function(event, a, b, c) {
equals( event.type, "click", "check passed data" );
// Trigger only the handlers (no native) and extra fn, with external event obj
// Triggers 9
equals( $("#firstp").triggerHandler("click", [eventObj, 1, "2", "abc"], handler), "test", "Verify handler response" );
+
+ var pass = true;
+ try {
+ $('input:first')
+ .hide()
+ .trigger('focus');
+ } catch(e) {
+ pass = false;
+ }
+ ok( pass, "Trigger focus on hidden element" );
// have the extra handler override the return
// Triggers 9