Sha256: e34196f5e754fea5547f805027ea46c5b0ec4c7104525725961e74c9bdb22579

Contents?: true

Size: 364 Bytes

Versions: 6

Compression:

Stored size: 364 Bytes

Contents

module UIControlWrap
  def when(events, options={}, &block)
    @callback ||= {}
    @callback[events] ||= []
    
    unless options[:append]
      @callback[events] = []
      removeTarget(nil, action: nil, forControlEvents: events)
    end

    @callback[events] << block
    addTarget(@callback[events].last, action:'call', forControlEvents: events)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bubble-wrap-1.3.0 motion/ui/ui_control.rb
bubble-wrap-1.3.0.osx motion/ui/ui_control.rb
bubble-wrap-1.2.0 motion/ui/ui_control.rb
bubble-wrap-1.2.0.pre motion/ui/ui_control.rb
bubble-wrap-1.1.5 motion/ui/ui_control.rb
bubble-wrap-1.1.4 motion/ui/ui_control.rb