From c573d29eb16c8dab6e5b4b1eea8fbdbe1b68333a Mon Sep 17 00:00:00 2001 From: SBD Date: Thu, 18 Jul 2024 14:03:05 +0300 Subject: [PATCH] documentation page --- static/aerbimCSS.css | 2 +- static/aerbimJS.js | 46 +++++++++++++++++++++++++++++--------------- 2 files changed, 32 insertions(+), 16 deletions(-) diff --git a/static/aerbimCSS.css b/static/aerbimCSS.css index 39eb8dd..cc06df7 100644 --- a/static/aerbimCSS.css +++ b/static/aerbimCSS.css @@ -1690,7 +1690,7 @@ body.n_scroll{ .documentation_version{ display: flex; align-items: center; - margin-bottom: 40px; + margin-bottom: 30px; } .documentation_version_switcher{ diff --git a/static/aerbimJS.js b/static/aerbimJS.js index 405ebac..f12f65f 100644 --- a/static/aerbimJS.js +++ b/static/aerbimJS.js @@ -510,22 +510,28 @@ function transitToDocumentation() { window.location.href = window.location.origin + '/' + getLang() + '/docs/3dsd/' } -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).css({rotate: '180deg'}) - let height = $content_part.offsetHeight - $content_part.style.bottom = '-' + height + "px" - $parent.style.borderBottom = '1px solid #fff' - } else { - $($arrow).css({rotate: '0deg'}) - $parent.style.borderBottom = '1px solid #CCCED1FF' - } +let switcherWorking = false - $("body")[0].setAttribute("onclick",'closeVersionSwitcherOnBody()') +function openVersionSwitcher(el){ + if (!switcherWorking){ + switcherWorking = true + 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).css({rotate: '180deg'}) + let height = $content_part.offsetHeight + $content_part.style.bottom = '-' + height + "px" + $parent.style.borderBottom = '1px solid #fff' + $("body")[0].setAttribute("onclick",'closeVersionSwitcherOnBody()') + } else { + $($arrow).css({rotate: '0deg'}) + $parent.style.borderBottom = '1px solid #CCCED1FF' + $("body")[0].setAttribute("onclick",'') + } + switcherWorking = false + } } function closeVersionSwitcherOnBody () { @@ -536,9 +542,19 @@ function closeVersionSwitcherOnBody () { $(".documentation_version_switcher").css({borderBottom: '1px solid #CCCED1FF'}) if ($arrow.style.rotate !== '180deg'){ $($arrow).css({rotate: '180deg'}) + } else { $($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",'') } }