Sha256: a6cbd0af923c955ceed35a4b94667a0ac0b331bb29cc0c29bd3adfd3a68a92f9

Contents?: true

Size: 666 Bytes

Versions: 13

Compression:

Stored size: 666 Bytes

Contents

module MotionPrime
  class SelectFieldSection < BaseFieldSection
    element :label, type: :label do
      default_label_options
    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 { |field| field.observing_errors? and field.all_errors.join("\n") }

    after_element_render :button, :bind_select_button

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

    def value
      view(:button).title
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
motion-prime-1.0.7 motion-prime/sections/form/select_field_section.rb
motion-prime-1.0.6 motion-prime/sections/form/select_field_section.rb
motion-prime-1.0.5 motion-prime/sections/form/select_field_section.rb
motion-prime-1.0.4 motion-prime/sections/form/select_field_section.rb
motion-prime-1.0.3 motion-prime/sections/form/select_field_section.rb
motion-prime-1.0.2 motion-prime/sections/form/select_field_section.rb
motion-prime-1.0.1 motion-prime/sections/form/select_field_section.rb
motion-prime-1.0.0 motion-prime/sections/form/select_field_section.rb
motion-prime-0.9.9.2 motion-prime/sections/form/select_field_section.rb
motion-prime-0.9.9.1 motion-prime/sections/form/select_field_section.rb
motion-prime-0.9.9 motion-prime/sections/form/select_field_section.rb
motion-prime-0.9.8 motion-prime/sections/form/select_field_section.rb
motion-prime-0.9.7 motion-prime/sections/form/select_field_section.rb