Sha256: ee1dcb42555e7507311bd3371956ce24efeea2252114598d234a12b33ce719d0

Contents?: true

Size: 644 Bytes

Versions: 10

Compression:

Stored size: 644 Bytes

Contents

module MotionPrime
  class SelectFieldSection < BaseFieldSection
    element :label, type: :label do
      options[:label] || {}
    end
    element :button, type: :button do
      options[:button] || {}
    end
    element :arrow, type: :image do
      options[:arrow] || {}
    end
    element :error_message, type: :error_message, text: proc { observing_errors? and all_errors.join("\n") }

    after_render :bind_select_button

    def bind_select_button
      view(:button).on :touch_down do
        form.send(options[:action]) if options[:action]
      end
    end

    def events_off
      view(:button).off :touch_down
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
motion-prime-0.7.0 motion-prime/sections/form/select_field_section.rb
motion-prime-0.6.0 motion-prime/sections/form/select_field_section.rb
motion-prime-0.5.7 motion-prime/sections/form/select_field_section.rb
motion-prime-0.5.6 motion-prime/sections/form/select_field_section.rb
motion-prime-0.5.5 motion-prime/sections/form/select_field_section.rb
motion-prime-0.5.4 motion-prime/sections/form/select_field_section.rb
motion-prime-0.5.3 motion-prime/sections/form/select_field_section.rb
motion-prime-0.5.2 motion-prime/sections/form/select_field_section.rb
motion-prime-0.5.1 motion-prime/sections/form/select_field_section.rb
motion-prime-0.5.0 motion-prime/sections/form/select_field_section.rb