Sha256: 538f9d582e4e2969fb7c53f366a0a859359bfbd0fa040d333decb6906fc0dd3a

Contents?: true

Size: 714 Bytes

Versions: 148

Compression:

Stored size: 714 Bytes

Contents

module EffectiveEditorHelper

  def effective_editor_tag(content, options = {})
    content = content.presence || '{}'

    content_mode = (
      if options.delete(:delta)
        :delta
      elsif options.delete(:html)
        :html
      elsif options.delete(:code)
        :code
      else
        :delta
      end
    )

    input_js = {
      method_name: 'effective_editor_tag',
      theme: 'snow',
      readOnly: true,
      content_mode: content_mode,
      modules: { toolbar: false, syntax: (content_mode == :code) }
    }

    content_tag(:div, '', id: "ql-#{content.object_id}", class: 'effective_editor_content ql-effective', data: { 'input-js-options': input_js, 'content': content })
  end

end

Version data entries

148 entries across 148 versions & 1 rubygems

Version Path
effective_bootstrap-0.5.12 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.5.11 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.5.10 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.5.9 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.5.8 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.5.7 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.5.6 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.5.5 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.5.4 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.5.3 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.5.2 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.5.1 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.5.0 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.4.8 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.4.7 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.4.6 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.4.5 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.4.4 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.4.3 app/helpers/effective_editor_helper.rb
effective_bootstrap-0.4.2 app/helpers/effective_editor_helper.rb