1 local CustomEvent = class('CustomEvent')
3 function CustomEvent:initialize(event_type, data)
7 self.current_target = nil
11 self.is_propagation_stopped = false
12 self.is_default_prevented = false
13 self.is_immediate_propagation_stopped = false
14 self.are_immediate_handlers_prevented = false
17 self.type = event_type
18 for k, v in pairs(data) do
23 function CustomEvent:stop_propagation()
24 self.is_propagation_stopped = true
27 function CustomEvent:prevent_default()
28 self.is_default_prevented = true
31 function CustomEvent:stop_immediate_propagation()
32 self.is_immediate_propagation_stopped = true
35 function CustomEvent:prevent_immediate_handlers()
36 self.are_immediate_handlers_prevented = true