Sha256: 7df597b90c29db81949bece3b0bed31e558a30ec0f9ed63f545c9a2a1378de0d

Contents?: true

Size: 693 Bytes

Versions: 3

Compression:

Stored size: 693 Bytes

Contents

module GlyphExtension

  # Render glyph and content html
  def glyph_and_content_html content_html = nil
    [glyph_with_space, ct_html(content_html)].compact.join(' ').html_safe
  end

  def ct_html content_html
    if options[:text].nil? || options[:text] == true
      content_html || content
    end
  end

  # Render glyph with space html
  def glyph_with_space
    out = [glyph]
    out << " " if options[:text] != false
    out.join unless glyph.nil?
  end

  # Render glyph html
  def glyph
    options[:content] = content if options[:text] == false
    options.delete(:status)
    options.delete(:class)
    UiBibz::Utils::GlyphChanger.new(options[:glyph], options).render
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ui_bibz-2.1.1 lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb
ui_bibz-2.0.10 lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb
ui_bibz-2.0.9 lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb