assign @element explicitly (remove create_element)
This commit is contained in:
parent
0d4813df13
commit
3fa685a0bb
@ -5,7 +5,6 @@ class ListView < ElementView
|
||||
def initialize children
|
||||
@children = children
|
||||
@elements = []
|
||||
@container_element = nil
|
||||
end
|
||||
|
||||
def root
|
||||
@ -13,13 +12,13 @@ class ListView < ElementView
|
||||
end
|
||||
|
||||
def draw on
|
||||
@container_element = div(self.root)
|
||||
@element = div(self.root)
|
||||
@elements = @children.collect do | c |
|
||||
elem = c.draw(@container_element)
|
||||
elem.append_to(@container_element)
|
||||
elem = c.draw(@element)
|
||||
elem.append_to(@element)
|
||||
elem
|
||||
end
|
||||
@container_element
|
||||
@element
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -20,10 +20,10 @@ class RegistersView < ListView
|
||||
def draw
|
||||
list = super()
|
||||
list = list.children.each do |reg|
|
||||
elem = create_element("div.register_view")
|
||||
elem = div("div.register_view")
|
||||
wrap_node_with reg , elem
|
||||
end
|
||||
@container_element
|
||||
@element
|
||||
end
|
||||
|
||||
def register_changed reg , old , value
|
||||
|
@ -5,7 +5,7 @@ class StatusView < ElementView
|
||||
end
|
||||
|
||||
def draw
|
||||
create_element(".status_view") <<
|
||||
@element = div(".status_view") <<
|
||||
div("h4.tick" , "Interpreter" ) <<
|
||||
div("span" , tick_text) <<
|
||||
div("button.act" , "Next") <<
|
||||
|
Loading…
Reference in New Issue
Block a user