Sha256: 7e1199645cb09879277ecc7a264de5f11d3883ecc1b750219508277ab80f41d3

Contents?: true

Size: 695 Bytes

Versions: 16

Compression:

Stored size: 695 Bytes

Contents

class Card
  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 & 2 rubygems

Version Path
card-mod-bootstrap-0.13.4 lib/card/lazy_tab.rb
card-mod-bootstrap-0.13.3 lib/card/lazy_tab.rb
card-mod-bootstrap-0.13.2 lib/card/lazy_tab.rb
card-mod-bootstrap-0.13.1 lib/card/lazy_tab.rb
card-mod-bootstrap-0.13.0 lib/card/lazy_tab.rb
card-mod-bootstrap-0.11.7 lib/card/lazy_tab.rb
card-mod-bootstrap-0.12.0 lib/card/lazy_tab.rb
card-mod-bootstrap-0.11.6 lib/card/lazy_tab.rb
card-mod-bootstrap-0.11.5 lib/card/lazy_tab.rb
card-mod-bootstrap-0.11.4 lib/card/lazy_tab.rb
card-mod-bootstrap-0.11.3 lib/card/lazy_tab.rb
card-mod-bootstrap-0.11.2 lib/card/lazy_tab.rb
card-mod-bootstrap-0.11.1 lib/card/lazy_tab.rb
card-mod-bootstrap-0.11.0 lib/card/lazy_tab.rb
card-1.100.0 mod/bootstrap/lib/card/lazy_tab.rb
card-1.99.6 mod/bootstrap/lib/card/lazy_tab.rb