fix mom view update logic

This commit is contained in:
Torsten Ruger 2018-04-17 20:25:56 +03:00
parent e193d50efd
commit 07edd4ba60
2 changed files with 4 additions and 3 deletions

View File

@ -4,7 +4,7 @@ gem "opal"
gem 'opal-sprockets'
gem 'opal-browser'
gem "rubyx" , "0.6" , :path => "../rubyx"
gem "rubyx" , "0.6" , path: "../rubyx"
gem "rx-file" , :git => "https://github.com/ruby-x/rx-file"

View File

@ -18,9 +18,10 @@ class MomView < ListView
def instruction_changed
i = @interpreter.instruction
return unless i && i.source.is_a?(Mom::Instruction)
return if i.source == @current
@current = i.source
@element.at_css(".mom_bright").remove_class("mom_bright")
instruction_text = i.source.to_s
instruction = append_view( ConstantView.new( "span.mom_bright" , instruction_text ) )
instruction = append_view( ConstantView.new( "span.mom_bright" , @current.to_s ) )
wrap_node_with( instruction , div )
remove_first if( @elements.length > 6)
end