Jank's proposed:
Index: /Users/jan/webdev/moodev/mootools/trunk/Source/Element/Element.Event.js =================================================================== --- /Users/jan/webdev/moodev/mootools/trunk/Source/Element/Element.Event.js (revision 939) +++ /Users/jan/webdev/moodev/mootools/trunk/Source/Element/Element.Event.js (working copy) @@ -463,9 +463,10 @@ >myElement.fireEvent(type[, args[, delay]]); Arguments: - type - (string) The event name (e.g. 'click') - args - (mixed, optional) Array or single object, arguments to pass to the function. If more than one argument, must be an array. - delay - (number, optional) Delay (in ms) to wait to execute the event. + type - (string) The event name (e.g. 'click') + args - (mixed, optional) Array or single object, arguments to pass to the function. If more than one argument, must be an array. + delay - (number, optional) Delay (in ms) to wait to execute the event. + bubble - (boolean, optional: defaults to true) If set to false the event will not bubble up the document tree. Returns: (element) This Element. @@ -479,12 +480,18 @@ This will not fire the DOM Event (this concerns all inline events ie. onmousedown=".."). */ - fireEvent: function(type, args, delay){ + fireEvent: function(type, args, delay, bubble){ + if(!$defined(bubble)) bubble = true; if (this.$events && this.$events[type]){ this.$events[type].keys.each(function(fn){ - fn.create({'bind': this, 'delay': delay, 'arguments': args})(); + var ret = fn.create({'bind': this, 'delay': delay, 'arguments': args})(); + bubble &= !$defined(ret) || ret; }, this); } + if (bubble && this.parentNode && ($type(this) == 'element')) { + var parent = this.getParent(); + parent.fireEvent.apply(parent, arguments); + } return this; },