This commit is contained in:
SBD
2024-07-11 19:17:29 +03:00
parent a36401af3e
commit e586293ae0
3 changed files with 42 additions and 15 deletions

View File

@@ -511,13 +511,17 @@ function openVersionSwitcher(el){
let $parent = el.closest(".documentation_version_switcher")
let $content_part = $parent.querySelector(".documentation_switcher_content_part")
let $arrow = $parent.querySelector(".documentation_switcher_arrow_picture")
$content_part.classList.toggle("hidden")
if ($arrow.style.rotate === '0deg' || $arrow.style.rotate === '') {
$($arrow).animate({rotate: '180deg'},200)
let height = $content_part.offsetHeight
$content_part.style.bottom = '-' + height + "px"
$parent.style.borderBottom = '1px solid #fff'
} else {
$($arrow).animate({rotate: '0deg'},200)
$parent.style.borderBottom = '1px solid #CCCED1FF'
}
$content_part.classList.toggle("hidden")
$("body")[0].setAttribute("onclick",'closeVersionSwitcherOnBody()')
}
@@ -526,7 +530,8 @@ function closeVersionSwitcherOnBody () {
let $version_switcher_container_content = $(".documentation_switcher_content_part")
let $arrow = document.querySelector(".documentation_switcher_arrow_picture")
$version_switcher_container_content.addClass("hidden")
$($arrow).animate({rotate: '0deg'},200)
$(".documentation_version_switcher").css({borderBottom: '1px solid #CCCED1FF'})
$($arrow).animate({rotate: '180deg'},200)
}
}
@@ -598,4 +603,13 @@ $(window).scroll(function (){
}
}
}
})
})
function chooseVersionComplete (el) {
let url = el.dataset['url']
let title = el.dataset['title']
let $parent = el.closest(".documentation_version")
let $cur_selected = $parent.querySelector(".documentation_version_txt")
$cur_selected.innerHTML = title
window.location.href = window.location.origin + url
}