2015-07-22 15:22:54 +02:00
|
|
|
class RegisterView
|
|
|
|
|
|
|
|
include React::Component
|
2015-07-23 19:08:40 +02:00
|
|
|
required_param :interpreter
|
2015-07-24 12:56:31 +02:00
|
|
|
define_state :registers
|
|
|
|
|
|
|
|
before_mount do
|
|
|
|
interpreter.register_event(:register_changed, self)
|
|
|
|
registers! interpreter.registers
|
|
|
|
end
|
|
|
|
|
|
|
|
def register_changed reg , old , bl
|
|
|
|
registers! interpreter.registers
|
|
|
|
end
|
2015-07-22 15:22:54 +02:00
|
|
|
|
|
|
|
def render
|
2015-07-22 21:05:31 +02:00
|
|
|
div :class => :row do
|
2015-07-24 12:56:31 +02:00
|
|
|
registers.each do |r , has|
|
2015-07-22 21:05:31 +02:00
|
|
|
div :class => "col-md-1" do
|
2015-07-23 12:20:53 +02:00
|
|
|
"#{r} : #{has}"
|
2015-07-22 15:22:54 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|