Module:Collapsible list: Difference between revisions
m
1 revision imported from wikipedia:Module:Collapsible_list
(per this discussion) |
m (1 revision imported from wikipedia:Module:Collapsible_list) |
||
(6 intermediate revisions by 5 users not shown) | |||
Line 67:
end
listItems = table.concat( listItems )
-- hack around mw-collapsible show/hide jumpiness by looking for text-alignment
-- by setting a margin if centered
local textAlignmentCentered = 'text%-align%s*:%s*center'
local centeredTitle = (args.title_style and args.title_style:lower():match(textAlignmentCentered)
or args.titlestyle and args.titlestyle:lower():match(textAlignmentCentered))
local centeredTitleSpacing
if centeredTitle then
centeredTitleSpacing = 'margin: 0 4em'
else
centeredTitleSpacing = ''
end
-- Get class, style and title data.
local
'class',
local div1style = formatAttributes(▼
'mw-collapsible', not args.expand and 'mw-collapsed'
▲ )
local collapsibleContainerStyle = formatAttributes(
'style',
'text-align: center; font-size: 100%;',
args.frame_style,
args.framestyle
)
local
▲ local div2style = formatAttributes(
'style',
'line-height: 1.6em; font-
args.title_style,
args.titlestyle
)
'style',
centeredTitleSpacing
)
local title = args.title or 'List'
local ulclass = formatAttributes( 'class', '
local ulstyle = formatAttributes(
'style',
not args.bullets and 'list-style: none; margin-left: 0;',
args.list_style,
args.liststyle
)
-- Build the list.
return mw.ustring.format(
'<div%s%s>\n<div%s><div%s>%s</div></div>\n<ul%s%s>%s</ul>\n</div>',
collapsibleContainerClass, collapsibleContainerStyle,
) .. gettitlestyletracking(args.title_style or args.titlestyle)
end
|