提交 eff9cae3 编写于 作者: S Sebastien Deleuze

Add global language switch capabilities to the refdoc

See gh-21778
上级 32a942fd
......@@ -94,10 +94,10 @@ dependencies {
task extractDocResources(type: Sync) {
dependsOn configurations.docs
from "src/docs/asciidoc/"
from {
configurations.docs.collect { zipTree(it) }
}
from "src/docs/asciidoc/"
into "$buildDir/asciidoc/build"
}
......
<script type="text/javascript" src="js/tocbot/tocbot.min.js"></script>
<script type="text/javascript" src="js/toc.js"></script>
<script type="text/javascript" src="js/switch-language.js"></script>
\ No newline at end of file
function globalSwitch() {
$('.switch--item').each(function() {
$(this).off('click');
$(this).on('click', function() {
selectedText = $(this).text()
selectedIndex = $(this).index()
$(".switch--item").filter(function() { return ($(this).text() === selectedText) }).each(function() {
$(this).addClass('selected');
$(this).siblings().removeClass('selected');
selectedContent = $(this).parent().siblings(".content").eq(selectedIndex)
selectedContent.removeClass('hidden');
selectedContent.siblings().addClass('hidden');
});
});
});
}
$(globalSwitch);
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册