lib/motion-kit/helpers/tree_layout.rb in motion-kit-1.0.3 vs lib/motion-kit/helpers/tree_layout.rb in motion-kit-1.1.0

- old
+ new

@@ -213,21 +213,21 @@ # Instantiates a view via `create` and adds the view to the current target. # If there is no context, a default root view can be created if that has # been enabled (e.g. within the `layout` method). The block is run in the # context of the new view. - def add(element, element_id=nil, &block) + def add(element, element_id=nil, options={}, &block) # make sure we have a target - raises NoContextError if none exists self.target unless @context create_default_root_context end # We want to be sure that the element has a supeview or superlayer before # the style method is called. element = initialize_element(element, element_id) - self.apply(:add_child, element) + self.apply(:add_child, element, options) style_and_context(element, element_id, &block) element end