small improvements

This commit is contained in:
Torsten Ruger
2015-08-24 01:44:50 +02:00
parent a25d292e1f
commit 516b041bed
4 changed files with 7 additions and 6 deletions

View File

@ -18,7 +18,7 @@ class ElementView
# second argument is optional, but if given will be added as text (content) to the newly
# created Element
# return the new Element, which is not linked into the dom at that point (see << and add*)
def div name_class , text = nil
def div name_class = "div" , text = nil
name , clazz = name_class.split(".")
name = "div" if name.empty?
element = $document.create_element(name)

View File

@ -33,7 +33,8 @@ class ListView < ElementView
def append view
@children << view
rendered = view.draw
@elements << rendered
@element << rendered
@elements << rendered # add to internal array
@element << rendered # add to html children
rendered
end
end