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
|
def initialize children
|
||||||
@children = children
|
@children = children
|
||||||
@elements = []
|
@elements = []
|
||||||
@container_element = nil
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def root
|
def root
|
||||||
@ -13,13 +12,13 @@ class ListView < ElementView
|
|||||||
end
|
end
|
||||||
|
|
||||||
def draw on
|
def draw on
|
||||||
@container_element = div(self.root)
|
@element = div(self.root)
|
||||||
@elements = @children.collect do | c |
|
@elements = @children.collect do | c |
|
||||||
elem = c.draw(@container_element)
|
elem = c.draw(@element)
|
||||||
elem.append_to(@container_element)
|
elem.append_to(@element)
|
||||||
elem
|
elem
|
||||||
end
|
end
|
||||||
@container_element
|
@element
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -20,10 +20,10 @@ class RegistersView < ListView
|
|||||||
def draw
|
def draw
|
||||||
list = super()
|
list = super()
|
||||||
list = list.children.each do |reg|
|
list = list.children.each do |reg|
|
||||||
elem = create_element("div.register_view")
|
elem = div("div.register_view")
|
||||||
wrap_node_with reg , elem
|
wrap_node_with reg , elem
|
||||||
end
|
end
|
||||||
@container_element
|
@element
|
||||||
end
|
end
|
||||||
|
|
||||||
def register_changed reg , old , value
|
def register_changed reg , old , value
|
||||||
|
@ -5,7 +5,7 @@ class StatusView < ElementView
|
|||||||
end
|
end
|
||||||
|
|
||||||
def draw
|
def draw
|
||||||
create_element(".status_view") <<
|
@element = div(".status_view") <<
|
||||||
div("h4.tick" , "Interpreter" ) <<
|
div("h4.tick" , "Interpreter" ) <<
|
||||||
div("span" , tick_text) <<
|
div("span" , tick_text) <<
|
||||||
div("button.act" , "Next") <<
|
div("button.act" , "Next") <<
|
||||||
|
Loading…
Reference in New Issue
Block a user