Sha256: 39b42e2094c3adc0a4ca2d8d0934a1dda85a20f11e3f81f6e566e9d4743ad8b7

Contents?: true

Size: 584 Bytes

Versions: 7

Compression:

Stored size: 584 Bytes

Contents

# shared helper methods for link editor and nest editor

format :html do
  def tinymce_id
    params[:tinymce_id]
  end

  def apply_tm_snippet_data snippet
    data = { "data-tinymce-id": tinymce_id }
    data[:"data-tm-snippet-start"] = tm_param(:start) if tm_param(:start).present?
    data[:"data-tm-snippet-size"] = snippet.raw.size if tm_param(:raw).present?
    data["data-dismiss"] = "modal" if modal_tm_snippet_editor?
    data
  end

  def tm_param key
    params[:"tm_snippet_#{key}"]
  end

  def modal_tm_snippet_editor?
    @tm_snippet_editor_mode != :overlay
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
card-mod-tinymce_editor-0.1 set/all/reference_editor.rb
card-1.100.0 mod/tinymce_editor/set/all/reference_editor.rb
card-1.99.6 mod/tinymce_editor/set/all/reference_editor.rb
card-1.99.5 mod/tinymce_editor/set/all/reference_editor.rb
card-1.99.4 mod/tinymce_editor/set/all/reference_editor.rb
card-1.99.3 mod/tinymce_editor/set/all/reference_editor.rb
card-1.99.2 mod/tinymce_editor/set/all/reference_editor.rb