Line 25:
Line 25:
|- class="mw-customtoggle-${id}" style="cursor:pointer;"
|- class="mw-customtoggle-${id}" style="cursor:pointer;"
!colspan="3"|${title}
!colspan="3"|${title}
−
|- class="mw-collapsible mw-collapsed" id="mw-customcollapsible-${id}"
+
|- class="mw-collapsible ${collapsed}" id="mw-customcollapsible-${id}"
!colspan="2"|Nodes||Rules
!colspan="2"|Nodes||Rules
${rows}
${rows}
|}]],
|}]],
−
_row_start_template = [[|- class="mw-collapsible mw-collapsed" id="mw-customcollapsible-${id}"
+
_row_start_template = [[|- class="mw-collapsible ${collapsed}" id="mw-customcollapsible-${id}"
|rowspan="${rowspan}" style="text-align:center;vertical-align:middle;width:50px;"|${from}]],
|rowspan="${rowspan}" style="text-align:center;vertical-align:middle;width:50px;"|${from}]],
−
_row_separator_template = [[|- class="mw-collapsible mw-collapsed" id="mw-customcollapsible-${id}"
+
_row_separator_template = [[|- class="mw-collapsible ${collapsed}" id="mw-customcollapsible-${id}"
]],
]],
−
_row_template = [[${separator}|class="mw-collapsible mw-collapsed" id="mw-customcollapsible-${id}" style="text-align:center;width:50px;"|${to}${rules}]],
+
_row_template = [[${separator}|class="mw-collapsible ${collapsed}" id="mw-customcollapsible-${id}" style="text-align:center;width:50px;"|${to}${rules}]],
_rules = "\n|rowspan=\"${span}\" style=\"padding:10px;\"|\n${rules}",
_rules = "\n|rowspan=\"${span}\" style=\"padding:10px;\"|\n${rules}",
Line 81:
Line 81:
self._vars = {
self._vars = {
id = args.id or args.title and make_id_from_title(args.title) or self._id,
id = args.id or args.title and make_id_from_title(args.title) or self._id,
−
-- id = args.id or args.title and make_id_from_title(args.title) or remiLib.timeHash(args) or self._id,
title = args.title or self._title,
title = args.title or self._title,
width = args.width or self._width,
width = args.width or self._width,
branching = { index = {} },
branching = { index = {} },
+
collapsed = args.expand and "" or "mw-collapsed",
}
}
local branching = self._vars.branching
local branching = self._vars.branching
Line 211:
Line 211:
from = self:format_node(from_node, branching[from_node].colors),
from = self:format_node(from_node, branching[from_node].colors),
id = self._vars.id,
id = self._vars.id,
+
collapsed = self._vars.collapsed,
})
})
local first = true
local first = true
Line 216:
Line 217:
table.insert(rows, format{
table.insert(rows, format{
self._row_template,
self._row_template,
−
separator = first and "" or format{self._row_separator_template, id = self._vars.id},
+
separator = first and "" or format{
+
self._row_separator_template,
+
id = self._vars.id,
+
collapsed = self._vars.collapsed,
+
},
to = self:format_node(to_node, branching[from_node][to_node].colors),
to = self:format_node(to_node, branching[from_node][to_node].colors),
rules = branching[from_node][to_node].rules and format{
rules = branching[from_node][to_node].rules and format{
Line 224:
Line 229:
} or "",
} or "",
id = self._vars.id,
id = self._vars.id,
+
collapsed = self._vars.collapsed,
})
})
first = false
first = false