Module:Sidebar: Difference between revisions
Appearance
add list-title-centered |
use list to be consistent |
||
Line 288: | Line 288: | ||
end | end | ||
local function | local function list_title(args, is_centered_list_titles, num) | ||
local title_text = trimAndAddAutomaticNewline(args['list' .. num .. 'title'] | local title_text = trimAndAddAutomaticNewline(args['list' .. num .. 'title'] | ||
Line 294: | Line 294: | ||
local title | local title | ||
if | if is_centered_list_titles then | ||
-- collapsible can be finicky, so provide some CSS/HTML to support | -- collapsible can be finicky, so provide some CSS/HTML to support | ||
title = mw.html.create('div') | title = mw.html.create('div') | ||
Line 333: | Line 333: | ||
local contentArgs = {} | local contentArgs = {} | ||
local | local is_centered_list_titles | ||
if args['centered collapsible titles'] and args['centered collapsible titles'] ~= '' then | if args['centered collapsible titles'] and args['centered collapsible titles'] ~= '' then | ||
is_centered_list_titles = true | |||
else | else | ||
is_centered_list_titles = false | |||
end | end | ||
Line 353: | Line 353: | ||
:cssText(args.listframestyle) | :cssText(args.listframestyle) | ||
:cssText(args['list' .. num .. 'framestyle']) | :cssText(args['list' .. num .. 'framestyle']) | ||
:node( | :node(list_title(args, is_centered_list_titles, num)) | ||
:tag('div') | :tag('div') | ||
:addClass(cfg.i18n.class.list_content) | :addClass(cfg.i18n.class.list_content) |