diff --git a/lib/base/list_view.rb b/lib/base/list_view.rb index 6baedd9..3c99acc 100644 --- a/lib/base/list_view.rb +++ b/lib/base/list_view.rb @@ -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 diff --git a/lib/registers_view.rb b/lib/registers_view.rb index 98994df..94410c5 100644 --- a/lib/registers_view.rb +++ b/lib/registers_view.rb @@ -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 diff --git a/lib/status_view.rb b/lib/status_view.rb index 8e3ea7d..e2c73c7 100644 --- a/lib/status_view.rb +++ b/lib/status_view.rb @@ -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") <<