diff --git a/Gemfile b/Gemfile index daf7a3c..ccc8ea7 100644 --- a/Gemfile +++ b/Gemfile @@ -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" diff --git a/lib/views/mom_view.rb b/lib/views/mom_view.rb index d41f01c..c9630aa 100644 --- a/lib/views/mom_view.rb +++ b/lib/views/mom_view.rb @@ -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