Sha256: 239b511312f31722f16a252c5f62c25ba36ba4586d04a93b9e8b07723e3032db

Contents?: true

Size: 637 Bytes

Versions: 10

Compression:

Stored size: 637 Bytes

Contents

module MotionPrime
  class DateFieldSection < BaseFieldSection
    container height: 190
    element :label, type: :label do
      default_label_options
    end
    element :input, type: :date_picker do
      options[:input] || {}
    end

    after_render :bind_input

    def bind_input
      picker = view(:input)
      picker.setDelegate form
      unless picker.date
        picker.setDate NSDate.date, animated: true
      end
      picker.on :change do
        form.send(options[:action]) if options[:action]
      end
    end

    def dealloc
      picker = view(:input)
      picker.setDelegate nil
      super
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
motion-prime-0.8.10 motion-prime/sections/form/date_field_section.rb
motion-prime-0.8.9 motion-prime/sections/form/date_field_section.rb
motion-prime-0.8.8 motion-prime/sections/form/date_field_section.rb
motion-prime-0.8.7 motion-prime/sections/form/date_field_section.rb
motion-prime-0.8.6 motion-prime/sections/form/date_field_section.rb
motion-prime-0.8.5 motion-prime/sections/form/date_field_section.rb
motion-prime-0.8.4 motion-prime/sections/form/date_field_section.rb
motion-prime-0.8.3 motion-prime/sections/form/date_field_section.rb
motion-prime-0.8.2 motion-prime/sections/form/date_field_section.rb
motion-prime-0.8.1 motion-prime/sections/form/date_field_section.rb