Sha256: ad8e285031be27180c6fa21956e8fe6b213fdd323d96cf80ce1139f025e194be

Contents?: true

Size: 589 Bytes

Versions: 10

Compression:

Stored size: 589 Bytes

Contents

require_relative 'field'

module Avo
  module Fields
    class MarkdownField < Field
      def initialize(name, **args, &block)
        @defaults = {
          component: 'markdown-field',
        }

        super(name, **args, &block)

        hide_on :index

        @always_show = args[:always_show].present? ? args[:always_show] : false
        @height = args[:height].present? ? args[:height].to_s : 'auto'
      end

      def hydrate_field(fields, model, resource, view)
        {
          always_show: @always_show,
          height: @height
        }
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
avo-0.4.10 lib/avo/app/fields/markdown_field.rb
avo-0.4.9 lib/avo/app/fields/markdown_field.rb
avo-0.4.8 lib/avo/app/fields/markdown_field.rb
avo-0.4.7 lib/avo/app/fields/markdown_field.rb
avo-0.4.6 lib/avo/app/fields/markdown_field.rb
avo-0.4.5 lib/avo/app/fields/markdown_field.rb
avo-0.4.4 lib/avo/app/fields/markdown_field.rb
avo-0.4.3 lib/avo/app/fields/markdown_field.rb
avo-0.4.2 lib/avo/app/fields/markdown_field.rb
avo-0.4.1 lib/avo/app/fields/markdown_field.rb