Sha256: 9d1256d7fef6ac6abdbc38375e99b7aa5bb11be1808c554fd54355665a2c2831

Contents?: true

Size: 745 Bytes

Versions: 115

Compression:

Stored size: 745 Bytes

Contents

# frozen_string_literal: true

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

115 entries across 115 versions & 1 rubygems

Version Path
effective_bootstrap-1.19.13 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.19.12 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.19.11 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.19.10 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.19.9 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.19.8 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.19.7 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.19.6 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.19.5 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.19.4 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.19.3 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.19.2 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.19.1 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.19.0 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.18.7 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.18.4 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.18.3 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.18.2 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.18.1 app/helpers/effective_editor_helper.rb
effective_bootstrap-1.18.0 app/helpers/effective_editor_helper.rb