documentation page
This commit is contained in:
@@ -16,6 +16,7 @@ $(document).ready(function (){
|
|||||||
setInfInCurtainDocumentationMobile()
|
setInfInCurtainDocumentationMobile()
|
||||||
setButtonOpenMobileDocCurtain()
|
setButtonOpenMobileDocCurtain()
|
||||||
}
|
}
|
||||||
|
windowScrollDocPage()
|
||||||
})
|
})
|
||||||
|
|
||||||
function setButtonOpenMobileDocCurtain () {
|
function setButtonOpenMobileDocCurtain () {
|
||||||
@@ -578,13 +579,57 @@ function showContentPartTree (el) {
|
|||||||
let $arrow = $parent.querySelector(".tree_documentation_arrow_img")
|
let $arrow = $parent.querySelector(".tree_documentation_arrow_img")
|
||||||
$content_part.classList.toggle("hidden")
|
$content_part.classList.toggle("hidden")
|
||||||
if ($arrow.style.rotate === '0deg' || $arrow.style.rotate === ''){
|
if ($arrow.style.rotate === '0deg' || $arrow.style.rotate === ''){
|
||||||
$($arrow).animate({rotate: '180deg'})
|
$($arrow).css({rotate: '180deg'})
|
||||||
} else {
|
} else {
|
||||||
$($arrow).animate({rotate: '0deg'})
|
$($arrow).css({rotate: '0deg'})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let waitingTop = null
|
let waitingTop = null
|
||||||
let maxScroll = null
|
let maxScroll = null
|
||||||
|
|
||||||
|
function windowScrollDocPage (){
|
||||||
|
if (getInfoAboutUser()[0] !== 'laptop' && getInfoAboutUser()[0] !== 'mobile'){
|
||||||
|
if (window.location.href.includes("docs")){
|
||||||
|
let $curtain = $(".left_curtain_documentation")
|
||||||
|
let scroll = $(window)[0].scrollY
|
||||||
|
if (scroll === 0){
|
||||||
|
waitingTop = $(".left_curtain_documentation")[0].getBoundingClientRect().top - 172
|
||||||
|
maxScroll = $(".documentation_block")[0].getBoundingClientRect().bottom - $(".left_curtain_documentation")[0].offsetHeight - 172
|
||||||
|
}
|
||||||
|
let $new_curtain = $($curtain[1])
|
||||||
|
|
||||||
|
if (scroll < maxScroll || !maxScroll){
|
||||||
|
if (!$curtain[1] && waitingTop){
|
||||||
|
$new_curtain = $curtain.clone()
|
||||||
|
$new_curtain.insertAfter($curtain)
|
||||||
|
let $new_curtain_tree = $new_curtain.find(".tree_documentation_container")
|
||||||
|
$new_curtain_tree.css({height: 'calc(100vh - 245px);'})
|
||||||
|
}
|
||||||
|
if (scroll >= waitingTop && waitingTop){
|
||||||
|
$new_curtain.css({position:'fixed',top: 166,bottom:"unset"})
|
||||||
|
$($curtain[0]).css({opacity:0})
|
||||||
|
$($curtain[0]).find(".tree_documentation_container").css({display:'none'})
|
||||||
|
} else if (scroll < waitingTop && waitingTop) {
|
||||||
|
$new_curtain.remove()
|
||||||
|
$($curtain[0]).css({opacity:1})
|
||||||
|
$($curtain[0]).find(".tree_documentation_container").css({display:'block'})
|
||||||
|
} else if (!waitingTop){
|
||||||
|
waitingTop = $(".left_curtain_documentation")[0].getBoundingClientRect().top - 172
|
||||||
|
maxScroll = $(".documentation_block")[0].getBoundingClientRect().bottom - $(".left_curtain_documentation")[0].offsetHeight - 172
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!$curtain[1]){
|
||||||
|
$new_curtain = $curtain.clone()
|
||||||
|
$new_curtain.insertAfter($curtain)
|
||||||
|
let $new_curtain_tree = $new_curtain.find(".tree_documentation_container")
|
||||||
|
$new_curtain_tree.css({height: 'calc(100vh - 245px);'})
|
||||||
|
}
|
||||||
|
$new_curtain.css({position:'absolute',bottom: 0,top: 'unset'})
|
||||||
|
$($curtain[0]).css({opacity:0})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$(window).scroll(function (){
|
$(window).scroll(function (){
|
||||||
if (getInfoAboutUser()[0] !== 'laptop' && getInfoAboutUser()[0] !== 'mobile'){
|
if (getInfoAboutUser()[0] !== 'laptop' && getInfoAboutUser()[0] !== 'mobile'){
|
||||||
if (window.location.href.includes("docs")){
|
if (window.location.href.includes("docs")){
|
||||||
@@ -608,6 +653,7 @@ $(window).scroll(function (){
|
|||||||
$($curtain[0]).css({opacity:0})
|
$($curtain[0]).css({opacity:0})
|
||||||
$($curtain[0]).find(".tree_documentation_container").css({display:'none'})
|
$($curtain[0]).find(".tree_documentation_container").css({display:'none'})
|
||||||
} else if (scroll < waitingTop && waitingTop) {
|
} else if (scroll < waitingTop && waitingTop) {
|
||||||
|
$($curtain[0]).find(".tree_documentation_container")[0].innerHTML = $($new_curtain[0]).find(".tree_documentation_container")[0].innerHTML
|
||||||
$new_curtain.remove()
|
$new_curtain.remove()
|
||||||
$($curtain[0]).css({opacity:1})
|
$($curtain[0]).css({opacity:1})
|
||||||
$($curtain[0]).find(".tree_documentation_container").css({display:'block'})
|
$($curtain[0]).find(".tree_documentation_container").css({display:'block'})
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
</a>
|
</a>
|
||||||
<div class="right_part_header">
|
<div class="right_part_header">
|
||||||
{# <a class="standart_txt text_header pointer">Поддержка</a>#}
|
{# <a class="standart_txt text_header pointer">Поддержка</a>#}
|
||||||
<a href="{% url 'docs_main' %}" class="standart_txt text_header last_left pointer">{% translate "Документация" %}</a>
|
<a href="{% url 'docs_main' %}" class="standart_txt text_header last_left pointer">{% translate "Поддержка" %}</a>
|
||||||
<a href="{% url 'contacts' %}" class="standart_txt text_header last_left pointer">{% translate "Контакты" %}</a>
|
<a href="{% url 'contacts' %}" class="standart_txt text_header last_left pointer">{% translate "Контакты" %}</a>
|
||||||
<div class="splitter_text_header"></div>
|
<div class="splitter_text_header"></div>
|
||||||
<div class="language_select close">
|
<div class="language_select close">
|
||||||
|
|||||||
@@ -72,7 +72,7 @@
|
|||||||
<div class="tree_documentation_container_first_level">
|
<div class="tree_documentation_container_first_level">
|
||||||
<div class="tree_documentation_container_first_line">
|
<div class="tree_documentation_container_first_line">
|
||||||
{% if obj.children %}
|
{% if obj.children %}
|
||||||
<picture class="tree_documentation_arrow_picture" onclick="showContentPartTree(this)">
|
<picture class="tree_documentation_arrow_picture" onclick="showContentPartTree(this)" {% if obj.active %}style="rotate: 180deg;"{% endif %}>
|
||||||
<source srcset="{% static "images/arrow_for_documentation_switcher.svg" %}">
|
<source srcset="{% static "images/arrow_for_documentation_switcher.svg" %}">
|
||||||
<img class="tree_documentation_arrow_img" src="{% static "images/arrow_for_documentation_switcher.svg" %}" alt="">
|
<img class="tree_documentation_arrow_img" src="{% static "images/arrow_for_documentation_switcher.svg" %}" alt="">
|
||||||
</picture>
|
</picture>
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
<div class="tree_documentation_container_second_level">
|
<div class="tree_documentation_container_second_level">
|
||||||
<div class="tree_documentation_container_first_line">
|
<div class="tree_documentation_container_first_line">
|
||||||
{% if obj.children %}
|
{% if obj.children %}
|
||||||
<picture class="tree_documentation_arrow_picture" onclick="showContentPartTree(this)">
|
<picture class="tree_documentation_arrow_picture" onclick="showContentPartTree(this)" {% if obj.active %}style="rotate: 180deg;"{% endif %}>
|
||||||
<source srcset="{% static "images/arrow_for_documentation_switcher.svg" %}">
|
<source srcset="{% static "images/arrow_for_documentation_switcher.svg" %}">
|
||||||
<img class="tree_documentation_arrow_img" src="{% static "images/arrow_for_documentation_switcher.svg" %}" alt="">
|
<img class="tree_documentation_arrow_img" src="{% static "images/arrow_for_documentation_switcher.svg" %}" alt="">
|
||||||
</picture>
|
</picture>
|
||||||
|
|||||||
Reference in New Issue
Block a user