slight improvement on the register view

still lagging, but …
This commit is contained in:
Torsten Ruger 2015-07-26 13:24:00 +03:00
parent add84432b4
commit 228b1b5832
3 changed files with 10 additions and 6 deletions

View File

@ -18,7 +18,8 @@ class BlockView
def update_block
block_name! interpreter.block.name
codes = interpreter.block.codes.dup
codes.shift while( codes.index(interpreter.instruction) > 1 )
slice = codes.index(interpreter.instruction) - 1
codes.shift( slice ) if slice >= 0
codes.pop while(codes.length > 4)
block! codes
end

View File

@ -9,7 +9,6 @@ class InstructionView
define_state :active => ""
before_mount do
interpreter.register_event(:instruction_changed, self)
check_active interpreter.instruction
end

View File

@ -26,9 +26,10 @@ class RegisterView
has_fields = []
clazz = object.class.name.split("::").last
puts "found #{clazz}"
has_fields << clazz
has_fields << clazz
object.get_instance_variables.each do |variable|
has_fields << object.get_instance_variable(variable).to_s
f = object.get_instance_variable(variable)
has_fields << f
end
fields! has_fields
end
@ -39,12 +40,15 @@ class RegisterView
div.col_md_12 do
objects_id.to_s
end
fields.each do |variable|
fields.each do |attribute|
div.col_md_12 do
variable.span
"#{marker(attribute)} - #{attribute.object_id}".span
end
end
end
end
def marker var
var.class.name.split("::").last[0]
end
end