documentation page

This commit is contained in:
SBD
2024-07-18 14:03:05 +03:00
parent f2c3ffe87b
commit c573d29eb1
2 changed files with 32 additions and 16 deletions

View File

@@ -1690,7 +1690,7 @@ body.n_scroll{
.documentation_version{ .documentation_version{
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 40px; margin-bottom: 30px;
} }
.documentation_version_switcher{ .documentation_version_switcher{

View File

@@ -510,7 +510,11 @@ function transitToDocumentation() {
window.location.href = window.location.origin + '/' + getLang() + '/docs/3dsd/' window.location.href = window.location.origin + '/' + getLang() + '/docs/3dsd/'
} }
let switcherWorking = false
function openVersionSwitcher(el){ function openVersionSwitcher(el){
if (!switcherWorking){
switcherWorking = true
let $parent = el.closest(".documentation_version_switcher") let $parent = el.closest(".documentation_version_switcher")
let $content_part = $parent.querySelector(".documentation_switcher_content_part") let $content_part = $parent.querySelector(".documentation_switcher_content_part")
let $arrow = $parent.querySelector(".documentation_switcher_arrow_picture") let $arrow = $parent.querySelector(".documentation_switcher_arrow_picture")
@@ -520,12 +524,14 @@ function openVersionSwitcher(el){
let height = $content_part.offsetHeight let height = $content_part.offsetHeight
$content_part.style.bottom = '-' + height + "px" $content_part.style.bottom = '-' + height + "px"
$parent.style.borderBottom = '1px solid #fff' $parent.style.borderBottom = '1px solid #fff'
$("body")[0].setAttribute("onclick",'closeVersionSwitcherOnBody()')
} else { } else {
$($arrow).css({rotate: '0deg'}) $($arrow).css({rotate: '0deg'})
$parent.style.borderBottom = '1px solid #CCCED1FF' $parent.style.borderBottom = '1px solid #CCCED1FF'
$("body")[0].setAttribute("onclick",'')
}
switcherWorking = false
} }
$("body")[0].setAttribute("onclick",'closeVersionSwitcherOnBody()')
} }
function closeVersionSwitcherOnBody () { function closeVersionSwitcherOnBody () {
@@ -536,9 +542,19 @@ function closeVersionSwitcherOnBody () {
$(".documentation_version_switcher").css({borderBottom: '1px solid #CCCED1FF'}) $(".documentation_version_switcher").css({borderBottom: '1px solid #CCCED1FF'})
if ($arrow.style.rotate !== '180deg'){ if ($arrow.style.rotate !== '180deg'){
$($arrow).css({rotate: '180deg'}) $($arrow).css({rotate: '180deg'})
} else { } else {
$($arrow).css({rotate: '0deg'}) $($arrow).css({rotate: '0deg'})
} }
if ($('.documentation_switcher_arrow_picture')[1]){
let arrow1 = $('.documentation_switcher_arrow_picture')[1]
if (arrow1.style.rotate !== '180deg'){
$(arrow1).css({rotate: '180deg'})
} else {
$(arrow1).css({rotate: '0deg'})
}
}
$("body")[0].setAttribute("onclick",'') $("body")[0].setAttribute("onclick",'')
} }
} }