Content deleted Content added
m fix function name typo |
take into account possible errors in generating collapsible notice rows |
||
Line 1,006:
-- Get action objects and the collapsible notice objects, and generate the
-- HTML objects for the action objects. We need the action HTML objects so
-- that we can accurately
-- action objects may generate errors when the HTML is generated.
local actions = self:getActionObjects() or {}▼
local collapsibleNotices = self:getCollapsibleNoticeObjects() or {}▼
local collapsibleNoticeHtmlObjects, actionHtmlObjects = {}, {}▼
▲ local actions = self:getActionObjects()
▲ local actionHtmlObjects = {}
▲ for _, obj in ipairs(actions or {}) do
table.insert(
actionHtmlObjects,
Line 1,018 ⟶ 1,017:
)
end
for _, obj in ipairs(collapsibleNotices) do
▲ local collapsibleNotices = self:getCollapsibleNoticeObjects()
table.insert(
local noCollapsibleRows = #actionHtmlObjects + #collapsibleNotices▼
collapsibleNoticeHtmlObjects,
self:try(obj.exportHtml, obj, self, true) -- Render the collapsed version
)
end
-- Find out if we are collapsed or not.
Line 1,029 ⟶ 1,033:
else
isCollapsed = noCollapsibleRows > (tonumber(self.cfg.uncollapsedRows) or 3)
end
-- If we are not collapsed, re-render the collapsible notices in the
-- non-collapsed version.
if not isCollapsed then
collapsibleNoticeHtmlObjects = {}
for _, obj in ipairs(collapsibleNotices) do
table.insert(
collapsibleNoticeHtmlObjects,
self:try(obj.exportHtml, obj, self, false)
)
end
end
|