From 3cf374c755b6c560aca0138c7e96273e85c6bca9 Mon Sep 17 00:00:00 2001 From: SBD Date: Tue, 28 Nov 2023 16:15:59 +0300 Subject: [PATCH] 0.0.39 --- static/aerbimJS.js | 11 ++++++++--- templates/blocks/dynamic/b_sections_buttons.html | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/static/aerbimJS.js b/static/aerbimJS.js index 55f0954..a59d5d7 100644 --- a/static/aerbimJS.js +++ b/static/aerbimJS.js @@ -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++ }) diff --git a/templates/blocks/dynamic/b_sections_buttons.html b/templates/blocks/dynamic/b_sections_buttons.html index 2b86dcf..eced6b6 100644 --- a/templates/blocks/dynamic/b_sections_buttons.html +++ b/templates/blocks/dynamic/b_sections_buttons.html @@ -2,7 +2,7 @@
{% for section in sections %} - +
{{ section.name }}
{% endfor %}