Sha256: c07c29fa5fa7f84d82d66d2e49eaaccfcb73179f321687cfc65076cd8b2e9527

Contents?: true

Size: 798 Bytes

Versions: 2

Compression:

Stored size: 798 Bytes

Contents

module MotionPrime
  class StringFieldSection < BaseFieldSection
    element :label, type: :label do
      {
        styles: [
          :base_field_label,
          :base_string_field_label,
          :"#{form_name}_field_label",
          :"#{form_name}_#{name}_field_label"
        ]
      }.merge(options[:label] || {})
    end
    element :input, type: :text_field do
      {
        styles: [
          :base_field_input,
          :base_string_field_input,
          :"#{form_name}_field_input",
          :"#{form_name}_#{name}_field_input"
        ],
      }.merge(options[:input] || {})
    end
    after_render :render_input

    def render_input
      view(:input).on :editing_did_begin do |view|
        scroll_to_and_make_visible
        form.on_edit(self)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
motion-prime-0.1.1 motion-prime/sections/form/string_field_section.rb
motion-prime-0.1.0 motion-prime/sections/form/string_field_section.rb