Sha256: c96f2c212d3ca0e5b1238d59709230de55e891fd1adb5b258e5fb41752023813

Contents?: true

Size: 473 Bytes

Versions: 2

Compression:

Stored size: 473 Bytes

Contents

module MotionPrime
  class BaseHeaderSection < BaseSection
    include CellSectionMixin
    DEFAULT_HEADER_HEIGHT = 20

    element :title, text: proc { @options[:title] }
    element :hint, text: proc { @options[:hint] }

    def initialize(options = {})
      @cell_type = :header
      super
    end

    def render_element?(name)
      @options[name].present?
    end

    def container_height
      container_options[:height] || DEFAULT_HEADER_HEIGHT
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
motion-prime-0.4.1 motion-prime/sections/form/base_header_section.rb
motion-prime-0.4.0 motion-prime/sections/form/base_header_section.rb