mirror of
https://github.com/lxsang/antd-web-apps
synced 2025-07-17 06:09:50 +02:00
minor fixes
This commit is contained in:
@ -1,12 +1,13 @@
|
||||
<?lua
|
||||
if not data then return end
|
||||
|
||||
local active = "_active"
|
||||
for k,v in pairs(data) do
|
||||
if v.children then
|
||||
?>
|
||||
<div class="container" id =<?='"toc'..v.id..'"'?>>
|
||||
<div class="container<?=active?>" id =<?='"toc'..v.id..'"'?>>
|
||||
<h1><?=v.name:gsub("^%d+%.","")?></h1>
|
||||
<?lua
|
||||
active = ''
|
||||
for l,child in pairs(v.children) do
|
||||
?>
|
||||
<div class="sub-container">
|
||||
@ -50,9 +51,10 @@
|
||||
<?lua
|
||||
else
|
||||
?>
|
||||
<div class="container" id =<?='"toc'..v.id..'"'?>>
|
||||
<div class="container<?=active?>" id =<?='"toc'..v.id..'"'?>>
|
||||
<h1><?=v.name?></h1>
|
||||
<?lua
|
||||
active = ''
|
||||
if v.sections then
|
||||
for m, entry in pairs(v.sections) do
|
||||
?>
|
||||
|
@ -11,6 +11,22 @@
|
||||
<?lua
|
||||
end
|
||||
?>
|
||||
<script>
|
||||
var switchTab = function(id, e)
|
||||
{
|
||||
var els = document.getElementsByClassName("container_active");
|
||||
var tab = document.getElementById(id)
|
||||
var tactiv = document.getElementsByClassName("toc_active");
|
||||
if(els.length == 0) return;
|
||||
if(!tab) return;
|
||||
if(tactiv.length == 0) return;
|
||||
els[0].className = "container";
|
||||
tab.className = "container_active";
|
||||
tactiv[0].className = "";
|
||||
e.parentElement.className = "toc_active";
|
||||
console.log('switch to ', id, e);
|
||||
}
|
||||
</script>
|
||||
<title>Porfolio</title>
|
||||
</head>
|
||||
<body>
|
||||
@ -31,7 +47,7 @@
|
||||
__main__:render()
|
||||
end
|
||||
?>
|
||||
<div class = "container">
|
||||
<div class = "container_footer">
|
||||
<h1 style="margin:0;"></h1>
|
||||
<p style="text-align:right; padding:0; margin:0;color:#878887;">Powered by antd server, (C) 2017-2018 Xuan Sang LE</p>
|
||||
</div>
|
||||
|
@ -5,10 +5,12 @@
|
||||
<div class = "cv-toc">
|
||||
<ul>
|
||||
<?lua
|
||||
local active = "toc_active"
|
||||
for k, v in pairs(data) do
|
||||
?>
|
||||
<li><a href=<?='"#toc'..v[2]..'"'?>><?=v[1]?></a></li>
|
||||
<li class="<?=active?>"><a href=<?='"#toc'..v[2]..'"'?> onclick='switchTab("toc<?=v[2]?>", this)' ><?=v[1]?></a></li>
|
||||
<?lua
|
||||
active = ''
|
||||
end
|
||||
?>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user