class UiBibz::Ui::Core::Forms::Textareas::MarkdownEditorField
Create a MarkdownEditorField
This element is an extend of UiBibz::Ui::Core::Component
.
Attributes¶ ↑
-
content
- Content of element -
options
- Options of element -
html_options
- Html Options of element
Options¶ ↑
You can add HTML attributes using the html_options
. You can pass arguments in options attribute:
-
state
- (:disabled, :active) -
autofocus
- Boolean -
savable
- Boolean -
hideable
- Boolean -
hidden_buttons
- (Array || String) -
disabled_buttons
- (Array || String)
Signatures¶ ↑
UiBibz::Ui::Core::Forms::Textareas::MarkdownEditorField.new(content, options = {}, html_options = {}).render UiBibz::Ui::Core::Forms::Textareas::MarkdownEditorField.new(options = {}, html_options = {}) do content end.render
Examples¶ ↑
UiBibz::Ui::Core::Forms::Textareas::MarkdownEditorField.new('search', prepend: 'Prepend content', append: 'Append content', class: 'test') UiBibz::Ui::Core::Forms::Textareas::MarkdownEditorField.new(prepend: glyph('pencil'), append: glyph('camera-retro')) do #content end
Helper¶ ↑
markdown_editor_field(options = {}, html_options = {}) do # content end
Public Instance Methods
pre_render()
click to toggle source
Render html tag
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 52 def pre_render text_area_tag content, options[:value] || html_options[:value], html_options end
Private Instance Methods
autofocus()
click to toggle source
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 73 def autofocus add_html_data('autofocus') if options[:autofocus] end
component_html_data()
click to toggle source
Calls superclass method
UiBibz::Ui::Core::Component#component_html_data
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 58 def component_html_data super provide autofocus savable hideable icon_library hidden_buttons disabled_buttons end
component_html_options()
click to toggle source
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 101 def component_html_options options[:state] == :disabled ? { disabled: 'disabled' } : {} end
hideable()
click to toggle source
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 81 def hideable add_html_data('hideable') if options[:hideable] end
icon_library()
click to toggle source
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 85 def icon_library add_html_data('iconlibrary', value: 'fa') end
provide()
click to toggle source
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 69 def provide add_html_data('provide', value: 'markdown') end
savable()
click to toggle source
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 77 def savable add_html_data('savable') if options[:savable] end
status()
click to toggle source
# File lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb, line 97 def status "has-#{options[:status]}" if options[:status] end