remove the root function (pass to super now)

This commit is contained in:
Torsten Ruger
2015-08-22 19:28:09 +02:00
parent b8a0e5f8a3
commit caa1da342c
3 changed files with 5 additions and 15 deletions

View File

@ -7,17 +7,12 @@ class ListView < ElementView
@elements = []
end
# can be overriden to return a string that will be passed to div to create the root
# element for the list. See "div" in ElementView for possible strings
def root
"div"
end
# create a root node acording to the "root" function (default div)
# create a root node acording to the tag given (default div)
# The tag name will be passed to the div function, so class and id may be set as well (see there)
# draw all children and keep the elements as @elements
# return (as per base class) the single root of the collection
def draw
@element = div(self.root)
def draw root = "div"
@element = div(root)
@elements = @children.collect do | c |
add_element c.draw
end