class UiBibz::Ui::Core::Forms::Buttons::ButtonRefresh

Create a Button Refrash

Attributes

Options

You can add HTML attributes using the html_options. You can pass arguments in options attribute:

Signatures

UiBibz::Ui::Core::Forms::Buttons::RefreshButton.new(content, options = nil, html_options = nil)

UiBibz::Ui::Core::Forms::Buttons::RefreshButton.new(options = nil, html_options = nil) do
  content
end

Examples

UiBibz::Ui::Core::Forms::Buttons::RefreshButton.new('test', type: :primary, size: :xs).render

UiBibz::Ui::Core::Forms::Buttons::RefreshButton.new(type: :primary) do
  test
end.render

Public Instance Methods

pre_render() click to toggle source

See UiBibz::Ui::Core::Component.initialize

# File lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb, line 56
def pre_render
  button_refresh_html_tag
end

Private Instance Methods

button_refresh_html_tag() click to toggle source
# File lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb, line 62
def button_refresh_html_tag
  content_tag :span, glyph_and_content_html, html_options
end
cnt_opts() click to toggle source
# File lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb, line 75
def cnt_opts
  {
    events: options[:connect].try(:[], :events) || 'click',
    mode: options[:connect].try(:[], :mode) || 'remote',
    target: {
      selector: options[:connect].try(:[], :target).try(:[], :selector) || '',
      url: options[:connect].try(:[], :target).try(:[], :url) || '',
      data: options[:connect].try(:[], :target).try(:[], :data) || []
    }
  }
end
component_html_classes() click to toggle source
# File lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb, line 71
def component_html_classes
  super << %w[input-refresh-button btn]
end
component_options() click to toggle source
# File lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb, line 66
def component_options
  options[:connect] = cnt_opts
  super.merge({ glyph: 'sync-alt', status: options[:status] })
end
status() click to toggle source
# File lib/ui_bibz/ui/core/forms/buttons/button_refresh.rb, line 87
def status
  "btn-#{options[:status] || :secondary}"
end