0.0.39
This commit is contained in:
@@ -29,10 +29,14 @@ function sendWidthAjax () {
|
||||
return data
|
||||
}
|
||||
|
||||
function renderContent () {
|
||||
function renderContent (el=null) {
|
||||
let data = sendWidthAjax()
|
||||
let section_button = document.querySelector(".section_btn")
|
||||
data['section_url'] = section_button.dataset['url']
|
||||
if (!el) {
|
||||
let section_button = document.querySelector(".section_btn")
|
||||
data['section_url'] = section_button.dataset['url']
|
||||
} else {
|
||||
data['section_url'] = el.dataset['url']
|
||||
}
|
||||
$.ajax({
|
||||
headers: { "X-CSRFToken": $('input[name=csrfmiddlewaretoken]').val() },
|
||||
url: '/get_content_for_section/',
|
||||
@@ -79,6 +83,7 @@ function replaceHrefOnOnclick () {
|
||||
str = str.replace(str_f_replace,'')
|
||||
str = str.replace('"target="_blank""','')
|
||||
cur_el.outerHTML = str
|
||||
cur_el.setAttribute("onclick",`renderContent(this)`)
|
||||
}
|
||||
i++
|
||||
})
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="container_sections_buttons">
|
||||
<div class="cut-width container_content_sections_buttons">
|
||||
{% for section in sections %}
|
||||
<a href="{% url 'section_page' section.url %}" target="_blank" class="section_btn {% if section == cur_section or page == section %}open{% else %}close{% endif %} standart_txt pointer" data-url="{{ section.url }}">
|
||||
<a href="{% url 'section_page' section.url %}" class="section_btn {% if section == cur_section or page == section %}open{% else %}close{% endif %} standart_txt pointer" data-url="{{ section.url }}">
|
||||
<div class="txt_section standart_txt">{{ section.name }}</div>
|
||||
</a>
|
||||
{% endfor %}
|
||||
|
||||
Reference in New Issue
Block a user