• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
no edit summary
Line 57: Line 57:  
-- "headers" should be a table with which params are used
 
-- "headers" should be a table with which params are used
 
-- "bossNode" should be a single char with which node is the boss node
 
-- "bossNode" should be a single char with which node is the boss node
function p.renderEncounterTable(info,headers, bossNode)
+
function p.renderEncounterTable(info,headers, bossNode, collapsed)
 
     function getRowSize(table, recurse)
 
     function getRowSize(table, recurse)
 
         if recurse == nil then recurse = false end
 
         if recurse == nil then recurse = false end
Line 78: Line 78:  
     local body = mw.html.create("table")
 
     local body = mw.html.create("table")
 
     body:addClass("wikitable")
 
     body:addClass("wikitable")
 +
    body:addClass("collapsible")
 +
    if collapsed then
 +
        body:addClass("collapsed")
 +
    end
 
     local titleRow = mw.html.create("tr")
 
     local titleRow = mw.html.create("tr")
 
     local th = mw.html.create("th")
 
     local th = mw.html.create("th")
Line 264: Line 268:  
         bossNode = frame.args["boss"]
 
         bossNode = frame.args["boss"]
 
     end
 
     end
 +
 +
    --Whether table should be collapsed by default or not
 +
    local collapsed = true
 +
    if frame.args["collapsed"] ~= nil then
 +
        if string.lower(frame.args["collapsed"]) == "false" then
 +
            collapsed = false
 +
        end
 +
    end
 +
      Line 337: Line 350:  
         end
 
         end
 
     end  
 
     end  
     html = p.renderEncounterTable(mapEncounterTable,usedParams,bossNode)
+
     html = p.renderEncounterTable(mapEncounterTable,usedParams,bossNode,collapsed)
    
     return html
 
     return html
2,922

edits

Navigation menu