lib/apotomo/widget.rb in apotomo-1.2.0 vs lib/apotomo/widget.rb in apotomo-1.2.1

- old
+ new

@@ -70,18 +70,20 @@ abstract! undef :display # We don't want #display to be listed in #internal_methods. alias_method :widget_id, :name + attr_reader :options after_initialize do run_hook :has_widgets, self end def initialize(parent, id, options={}) - super(parent, options) # TODO: do that as long as cells do need a parent_controller. remember to remove options for cells 3.7. + super(parent) # TODO: do that as long as cells do need a parent_controller. + @options = options @name = id @visible = true setup_tree_node(parent) @@ -97,10 +99,10 @@ @visible end # Invokes +state+ and hopefully returns the rendered content. def invoke(state, *args) - return render_state(state, *args) if state_accepts_args?(state) + return render_state(state, *args) if method(state).arity != 0 # TODO: remove check and make trigger states receive the evt default. render_state(state) end # Renders and returns a view for the current state. That's why it is usually called at the end of # a state method.