יחידה:גרפים: הבדלים בין גרסאות בדף
עדכון לפונקציה createGroupList בלבד |
|||
| שורה 65: | שורה 65: | ||
local function createGroupList( tab, legends, cols ) | local function createGroupList( tab, legends, cols ) | ||
if #legends > 1 | if #legends > 1 then | ||
table.insert( tab, mw.text.tag( 'div' ) ) | table.insert( tab, mw.text.tag( 'div' ) ) | ||
local list = {} | local list = {} | ||
local spanStyle = "padding:0 1em;background-color:%s; | local spanStyle = "padding:0 1em;background-color:%s;box-shadow:2px -1px 4px 0 silver;margin-right:1em;" | ||
for gi = 1, #legends do | for gi = 1, #legends do | ||
local span = mw.text.tag( 'span', { style = string.format( spanStyle | local span = mw.text.tag( 'span', { style = string.format( spanStyle, cols[gi] ) }, ' ' ) .. ' '.. legends[gi] | ||
table.insert( list, mw.text.tag( 'li', {}, span ) ) | table.insert( list, mw.text.tag( 'li', {}, span ) ) | ||
end | end | ||
table.insert( tab, | table.insert( tab, | ||
mw.text.tag( 'ul', | mw.text.tag( 'ul', | ||
-- chrome bug with column display with rtl. {style="text-align:right;width:100%;list-style:none;-webkit-column-width:12em;-moz-column-width:12em;column-width:12em"}, | |||
{style="width:100%;list-style:none | {style="text-align:right;width:100%;list-style:none;-moz-column-width:12em;column-width:12em"}, | ||
table.concat( list, '\n' ) | table.concat( list, '\n' ) | ||
) | ) | ||