Sha256: 4aa62eaf1660b5e5c32e6f196ee17de31fcbb7541e0351d3176c581c51a96e2c

Contents?: true

Size: 640 Bytes

Versions: 9

Compression:

Stored size: 640 Bytes

Contents

module Locomotive
  module Liquid
    module Tags
      module Editable
        class Control < Base

          protected

          def default_element_attributes
            if @nodelist.first.is_a?(String)
              super.merge(content: @nodelist.first.try(:to_s), options: @options[:options])
            else
              super
            end
          end

          def render_element(context, element)
            element.content
          end

          def document_type
            EditableControl
          end

        end

        ::Liquid::Template.register_tag('editable_control', Control)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
locomotive_cms-2.2.3 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.2.2 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.2.1 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.2.0 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.1.4 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.1.3 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.1.2 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.1.1 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.1.0 lib/locomotive/liquid/tags/editable/control.rb