1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2025-07-23 17:19:47 +02:00

enable mobile compatibility

This commit is contained in:
lxsang
2021-02-07 11:35:26 +01:00
parent 0c6d81ef93
commit 3f1530cfe8
4 changed files with 27 additions and 11 deletions

View File

@ -117,8 +117,8 @@ div.search-icon {
width: 35px;
}
div.doc-toc {
width: 300px;
/* font-size: 11px; */
max-width: 80%;
padding-right: 10px;
background-color: #e3e3e3;
color: #2c2c2c;
overflow: auto;
@ -127,7 +127,16 @@ div.doc-toc {
bottom: 30px;
border-right: 1px solid #c9c9c9;
padding-top: 10px;
box-shadow: 2px 0px 7px #878887;
z-index: 20;
}
button#btn_toc {
width: 33px;
height: 33px;
position: fixed;
border: 1px solid #dadddd;
}
div.doc-toc a {
text-decoration: none;
color: #2c2c2c;
@ -178,7 +187,7 @@ div.doc-toc a.highlight {
div.doc-content {
display: block;
width: calc(100% - 300px);
width: calc(100% - 30px);
float: right;
padding-left: 10px;
}

View File

@ -13,7 +13,7 @@ local pre_process_md = function(str, obj)
"%%-")
if apath then
apath = apath:gsub(" ", "%%%%20")
print(apath)
--print(apath)
content = content:gsub(pattern, "![](" .. HTTP_ROOT .. "/" ..
obj.name .. "/asset/" .. apath .. ")")
end

View File

@ -111,7 +111,8 @@ local url = __main__:get("url")
<?lua
if tocdata then
?>
<div class = "doc-toc">
<button id="btn_toc" class="fa fa-bars"></button>
<div id="doc_toc" class = "doc-toc">
<?lua
if toc then
toc:set("data", tocdata)
@ -119,7 +120,7 @@ local url = __main__:get("url")
end
?>
</div>
<div class="doc-content markdown-body">
<div class="doc-content markdown-body" id="doc_content">
<?lua
if __main__ then
__main__:render()
@ -145,6 +146,12 @@ local url = __main__:get("url")
</div>
<script>
window.addEventListener('load', (event) => {
$("#btn_toc").click(function(){
$("#doc_toc").toggle();
});
$("#doc_content").click(function(){
$("#doc_toc").hide();
});
// tree view events
var toggler = document.getElementsByClassName("caret");
var i;