apotonick/apotomo — Issue #56: Event dispatching bug
Author: maxkazar
Created: 2012-01-19 15:07:25+00:00
State: open

When page contains two widget of one class and responds to event with option **:passing**, then only first widget in widget collection processing event. File **lib/apotomo/widget/event_methods.rb** contains method **after_initialize**

if target_id = options[:passing]
target = root.find_widget(target_id)
options[:on] ||= widget_id
end

and option must be copy, like this

if target_id = options[:passing]
options = options.copy
target = root.find_widget(target_id)
options[:on] ||= widget_id
end

because options **:on** add to widget class and for next widget a page will has id of first widget