small improvements
This commit is contained in:
parent
a25d292e1f
commit
516b041bed
@ -18,7 +18,7 @@ class ElementView
|
|||||||
# second argument is optional, but if given will be added as text (content) to the newly
|
# second argument is optional, but if given will be added as text (content) to the newly
|
||||||
# created Element
|
# created Element
|
||||||
# return the new Element, which is not linked into the dom at that point (see << and add*)
|
# 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 , clazz = name_class.split(".")
|
||||||
name = "div" if name.empty?
|
name = "div" if name.empty?
|
||||||
element = $document.create_element(name)
|
element = $document.create_element(name)
|
||||||
|
@ -33,7 +33,8 @@ class ListView < ElementView
|
|||||||
def append view
|
def append view
|
||||||
@children << view
|
@children << view
|
||||||
rendered = view.draw
|
rendered = view.draw
|
||||||
@elements << rendered
|
@elements << rendered # add to internal array
|
||||||
@element << rendered
|
@element << rendered # add to html children
|
||||||
|
rendered
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -23,7 +23,6 @@ class BlocksView < ListView
|
|||||||
new_name = method_name
|
new_name = method_name
|
||||||
return if new_name == @method_name
|
return if new_name == @method_name
|
||||||
@method_name = new_name
|
@method_name = new_name
|
||||||
puts "changed new_name #{@method_name}"
|
|
||||||
@element.at_css(".method").text = method_name
|
@element.at_css(".method").text = method_name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -7,9 +7,10 @@ class StatusView < ElementView
|
|||||||
def draw
|
def draw
|
||||||
@element = div(".status_view") <<
|
@element = div(".status_view") <<
|
||||||
div("h4" , "Interpreter" ) <<
|
div("h4" , "Interpreter" ) <<
|
||||||
div("span.clock" , clock_text) <<
|
|
||||||
div("button.act" , "Next") <<
|
div("button.act" , "Next") <<
|
||||||
div( "br") <<
|
div( "br") <<
|
||||||
|
div("span.clock" , clock_text) <<
|
||||||
|
div( "br") <<
|
||||||
div("span.state" , state_text) <<
|
div("span.state" , state_text) <<
|
||||||
div( "br") <<
|
div( "br") <<
|
||||||
div( "span.link" , link_text) <<
|
div( "span.link" , link_text) <<
|
||||||
|
Loading…
x
Reference in New Issue
Block a user