Sha256: cf26c8df41bd34ff56a53f7d1134c25b2a75c19869d4e21854620acf5074778d
Contents?: true
Size: 771 Bytes
Versions: 16
Compression:
Stored size: 771 Bytes
Contents
class Card # lazy-loading tabs. Tab panel content doesn't load until tab is visited. class LazyTab < Tab def url @url ||= (config_hash? && @config[:path]) || format.path(view: view) end def view @view ||= (config_hash? && @config[:view]) || @config end def tab_button if url super else wrap_with(:li, label, role: "presentation") end end def button_attrib @button_attrib ||= super.merge("data-url" => url.html_safe) end def tab_button_link add_class button_attrib, "load" unless active? super end def content @content ||= "" end def tab_pane args=nil, &block @content = yield if active? && block_given? super end end end
Version data entries
16 entries across 16 versions & 1 rubygems