Skip to content

Commit

Permalink
have contents public
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed May 16, 2017
1 parent 8f2d0b1 commit 1692e86
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions library/cwm/src/lib/cwm/table.rb
Expand Up @@ -65,6 +65,18 @@ def modify_cell(id, collumn_number, cell_content)
Yast::UI.ChangeWidget(Id(widget_id), Cell(id, collumn_number), cell_content)
end

# Resulting table as YUI term.
# @note used mainly to pass it CWM.
def contents
opt_args = respond_to?(:opt, true) ? opt : []
Table(
Id(widget_id),
Opt(*opt_args),
Header(*header),
format_items(items)
)
end

protected

# helper to create icon term
Expand Down Expand Up @@ -94,16 +106,6 @@ def multiselection?

private

def contents
opt_args = respond_to?(:opt, true) ? opt : []
Table(
Id(widget_id),
Opt(*opt_args),
Header(*header),
format_items(items)
)
end

def format_items(items)
items.map do |item|
Item(Id(item.first), *item[1..-1])
Expand Down

0 comments on commit 1692e86

Please sign in to comment.