Sha256: 361be9ccb5ab6abf4965d458dbb69e77bcbb6528c0e8d70b2dfb466ebed5eb4b

Contents?: true

Size: 850 Bytes

Versions: 19

Compression:

Stored size: 850 Bytes

Contents

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

          protected

          def default_element_attributes
            if @nodelist.first.is_a?(String)
              content = self.render_default_content(@nodelist.first)

              super.merge(content: content, options: @options[:options])
            else
              super
            end
          end

          def render_element(context, element)
            element.content
          end

          def document_type
            EditableControl
          end

          def render_default_content(node)
            if node
              node.to_s.strip
            else
              nil
            end
          end

        end

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

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
locomotive_cms-2.5.7 lib/locomotive/liquid/tags/editable/control.rb
locomotivecms-3.0.0.pre.alpha.2 lib/locomotive/previous_liquid/tags/editable/control.rb
locomotivecms-3.0.0.pre.alpha lib/locomotive/previous_liquid/tags/editable/control.rb
locomotive_cms-2.5.6 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.5.6.rc2 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.5.6.rc1 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.5.5 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.5.4 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.5.3 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.5.2 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.5.1 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.5.0 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.5.0.rc3 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.5.0.rc2 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.5.0.rc1 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.4.1 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.4.0 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.3.1 lib/locomotive/liquid/tags/editable/control.rb
locomotive_cms-2.3.0 lib/locomotive/liquid/tags/editable/control.rb