5 Star 9 Fork 1

Gitee 极速下载 / FydeOS

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/FydeOS/fydeos.github.io
克隆/下载
help.html 2.33 KB
一键复制 编辑 原始数据 按行查看 历史
Alpha 提交于 2020-10-16 13:57 . url variable fix and add new help contents
---
---
<section class="help">
<div class="accordion" id="accordionHelp">
<div class="card">
{% assign help_sections = site.data.help_sections[site.active_lang] %}
{% for help_section_item in help_sections %}
<div class="card-header" id="heading{{ forloop.index }}">
<h5 class="mb-0">
<button class="btn btn-link" type="button" data-toggle="collapse" data-target="#collapse{{ forloop.index }}" aria-expanded="true" aria-controls="collapse{{ forloop.index }}" data-slug="{{ help_section_item.slug }}">
{{ help_section_item.name }}
</button>
</h5>
</div>
<div id="collapse{{ forloop.index }}" class="collapse {% if forloop.last == true %}{{ "collapse-item-last" }}{% endif %}" aria-labelledby="heading{{ forloop.index }}" data-parent="#accordionHelp">
<div class="card-body">
{% assign sorted_help_items = site.help | sort: 'weight' | reverse %}
{% for item in sorted_help_items %}
{% if help_section_item.name == item.help_section %}
<div class="help-item-row">
<a href="{{ site.url }}{{ item.permalink }}">{{ item.title }}</a>
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% endfor %}
</div>
</div>
</section>
<script>
//init collapse state
var currentURL = window.location.href;
if (currentURL.indexOf("#") > -1)
{
var slug = currentURL.substr(currentURL.indexOf("#")+1);
var toUnCollapse = document.querySelector("button[data-slug="+slug+"]");
var toUnCollapseTarget = toUnCollapse.getAttribute('data-target');
document.querySelector(toUnCollapseTarget).classList.add('show');
var sectionContainer = document.querySelector('section.content');
window.scrollTo({
left: 0,
top: toUnCollapse.offsetTop + document.querySelector('header').offsetHeight,
behavior: 'smooth'
});
console.log("scrolled to");
console.log(toUnCollapse.offsetTop + document.querySelector('header').offsetHeight);
}
//handles button click and append slug to URL
var buttons = document.querySelectorAll("button.btn-link");
buttons.forEach((button) => {
button.addEventListener("click", (e)=> {
var appendix = "#" + e.target.dataset.slug;
window.history.replaceState(null, null, appendix);
});
});
</script>
C/C++
1
https://gitee.com/mirrors/FydeOS.git
git@gitee.com:mirrors/FydeOS.git
mirrors
FydeOS
FydeOS
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891