Sha256: cf9c611bf398a61a5aa61250ed7e6576684b65994eea34f06c43dc4c8ddb8efb

Contents?: true

Size: 868 Bytes

Versions: 5

Compression:

Stored size: 868 Bytes

Contents

# A "split" renderer is one that produces two different HTML fragments:
# one for the tabs, another for the subtabs.
#
# "Combined" renderers would embed the subtab HTML straight into the HTML for
# the tabs, producing just one HTML fragment.
#
# This class is meant to be subclassed.  It encapsulates the code
# common to all split renderers so that it doesn't have to be recoded
# everytime.

module Tabulous
  class SplitRenderer < BaseRenderer

    # all split renderers need to have a subtabs_html method that returns the
    # HTML to be embedded when the <%= subtabs %> helper method is called
    def subtabs_html
      raise "override me"
    end

  protected

    def subtab_list_html
      html = ''
      for tab in subtabs
        html << tab_html(tab)
      end
      html
    end

    def subtabs
      @tabset.visible_subtabs(@view)
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tabulous-2.1.4 lib/tabulous/renderers/split_renderer.rb
tabulous-2.1.3 lib/tabulous/renderers/split_renderer.rb
tabulous-2.1.2 lib/tabulous/renderers/split_renderer.rb
tabulous-2.1.1 lib/tabulous/renderers/split_renderer.rb
tabulous-2.1.0 lib/tabulous/renderers/split_renderer.rb