opal/virtual_dom_extension.rb in inesita-0.0.6 vs opal/virtual_dom_extension.rb in inesita-0.0.7
- old
+ new
@@ -3,10 +3,11 @@
def component(comp)
@nodes << NodeFactory.new(comp.method(:render), comp).nodes.first
end
def a(params, &block)
- params = { onclick: -> { Inesita::Router.handle_link(params[:href]) } }.merge(params) if params[:href]
+ #TODO: Only if router is configured
+ params = { onclick: -> { Inesita::Router.handle_link(params[:href], @parent) } }.merge(params) if params[:href]
@nodes << VirtualNode.new(
'a',
process_params(params),
block ? NodeFactory.new(block, @parent).nodes : []
).vnode