We no longer support globally-triggered events on plain objects. This is a trade-off to having good garbage collection on the objects.

This commit is contained in:
jeresig 2010-03-02 10:51:31 -05:00
parent 86ace44fbb
commit 5c111a028a

View file

@ -1715,24 +1715,15 @@ test("delegate with submit", function() {
}); });
test("Non DOM element events", function() { test("Non DOM element events", function() {
expect(3); expect(1);
jQuery({})
.bind('nonelementglobal', function(e) {
ok( true, "Global event on non-DOM annonymos object triggered" );
});
var o = {}; var o = {};
jQuery(o) jQuery(o).bind('nonelementobj', function(e) {
.bind('nonelementobj', function(e) {
ok( true, "Event on non-DOM object triggered" ); ok( true, "Event on non-DOM object triggered" );
}).bind('nonelementglobal', function() {
ok( true, "Global event on non-DOM object triggered" );
}); });
jQuery(o).trigger('nonelementobj'); jQuery(o).trigger('nonelementobj');
jQuery.event.trigger('nonelementglobal');
}); });
/* /*