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