Module:StreetBrawlItems: Difference between revisions

Jump to navigation Jump to search
Vergir (talk | contribs)
Common: use native collapsible toggle so its state class drives a flipping caret (with help from vergir-bot LLM)
Vergir (talk | contribs)
Common: div collapsible with inside custom-toggle label; caret driven by collapsed state, no native brackets (with help from vergir-bot LLM)
Line 122: Line 122:


if collapse then
if collapse then
-- Common: a native collapsible whose header ("Common") reads like the other
-- Common: a div collapsible with the label inside as a custom toggle (no native
-- labels; styles.css hides the default toggle text and shows a flipping caret.
-- toggle -> no brackets). The caret flips off the container's mw-collapsed state.
local id = "sbcommon-" .. hkey .. "-" .. tostring(tier or 0)
local head = (label ~= "" and label) or "Common"
local head = (label ~= "" and label) or "Common"
return '{| class="wikitable mw-collapsible mw-collapsed sb-common"\n'
return '<div class="sb-common mw-collapsible mw-collapsed" id="mw-customcollapsible-' .. id .. '">'
.. '! class="sb-common-head" | ' .. head .. '\n|-\n'
.. '<div class="sb-common-head mw-customtoggle-' .. id .. '">' .. head .. '</div>'
.. '| <div class="sb-common-body">' .. table.concat(parts, " | ") .. '</div>\n|}'
.. '<div class="sb-common-body mw-collapsible-content">' .. table.concat(parts, " | ") .. '</div>'
.. '</div>'
end
end