Short-circuit initFooEvent while dispatching events.

This commit is contained in:
Josh Matthews 2014-11-12 14:23:52 -05:00
parent 642a3592c7
commit c23edf6f5a
5 changed files with 23 additions and 4 deletions

View file

@ -89,6 +89,10 @@ impl<'a> UIEventMethods for JSRef<'a, UIEvent> {
view: Option<JSRef<Window>>,
detail: i32) {
let event: JSRef<Event> = EventCast::from_ref(self);
if event.dispatching() {
return;
}
event.InitEvent(type_, can_bubble, cancelable);
self.view.assign(view);
self.detail.set(detail);