Module: Avo::Fields::Concerns::HasResizableEditor

Extended by:
ActiveSupport::Concern
Included in:
BaseField
Defined in:
lib/avo/fields/concerns/has_resizable_editor.rb

Constant Summary collapse

COMPATIBLE_EDITOR_SELECTORS =
{
  "lexical" => "[contenteditable='true']",
  "lexxy" => "lexxy-editor > .lexxy-editor__content",
  "markdown" => ".marksmith-textarea",
  "rhino" => "avo-rhino-editor > .trix-content[slot='editor']"
}.freeze

Instance Method Summary collapse

Instance Method Details

#resizable_editor?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/avo/fields/concerns/has_resizable_editor.rb', line 29

def resizable_editor?
  resizable_editor_target_selector.present?
end

#resizable_editor_target_selectorObject



33
34
35
# File 'lib/avo/fields/concerns/has_resizable_editor.rb', line 33

def resizable_editor_target_selector
  self.class.resizable_editor_selector || COMPATIBLE_EDITOR_SELECTORS[type.to_s]
end