fix mom view update logic
This commit is contained in:
parent
e193d50efd
commit
07edd4ba60
2
Gemfile
2
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"
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user