0.0.280
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
page_iterator = 2
|
page_iterator = 2
|
||||||
standart_page_iterator = 1
|
standart_page_iterator = 1
|
||||||
separator_iterator = 1
|
separator_iterator = 1
|
||||||
|
iterator_f_check = 1
|
||||||
|
|
||||||
function load_routes (el,news=null) {
|
function load_routes (el,news=null) {
|
||||||
let local_page_iterator = standart_page_iterator
|
let local_page_iterator = standart_page_iterator
|
||||||
@@ -8,12 +9,12 @@ function load_routes (el,news=null) {
|
|||||||
local_page_iterator = page_iterator
|
local_page_iterator = page_iterator
|
||||||
}
|
}
|
||||||
let number_last_route = el.id
|
let number_last_route = el.id
|
||||||
let incrase = 3
|
let incrase = 2
|
||||||
if (!news){
|
if (!news){
|
||||||
incrase = 11
|
incrase = 10
|
||||||
}
|
}
|
||||||
let data_d = {
|
let data_d = {
|
||||||
'from_el':parseInt(number_last_route) + 1,
|
'from_el':parseInt(number_last_route),
|
||||||
'to_el':parseInt(number_last_route) + incrase
|
'to_el':parseInt(number_last_route) + incrase
|
||||||
}
|
}
|
||||||
let get_url = ""
|
let get_url = ""
|
||||||
@@ -65,7 +66,10 @@ function load_routes (el,news=null) {
|
|||||||
|
|
||||||
place_ins.innerHTML = data.html
|
place_ins.innerHTML = data.html
|
||||||
let old_page_iterator = local_page_iterator
|
let old_page_iterator = local_page_iterator
|
||||||
|
// standart_page_iterator++
|
||||||
local_page_iterator++
|
local_page_iterator++
|
||||||
|
page_iterator++
|
||||||
|
standart_page_iterator++
|
||||||
loader.classList.toggle("show")
|
loader.classList.toggle("show")
|
||||||
if (!data.last_block_routes){
|
if (!data.last_block_routes){
|
||||||
el.classList.toggle("hide")
|
el.classList.toggle("hide")
|
||||||
@@ -81,12 +85,31 @@ function load_routes (el,news=null) {
|
|||||||
$(new_page_routes).insertAfter(".page_paging_elements_" + old_page_iterator);
|
$(new_page_routes).insertAfter(".page_paging_elements_" + old_page_iterator);
|
||||||
let line_separator = document.createElement("div")
|
let line_separator = document.createElement("div")
|
||||||
line_separator.classList.add("line_separator_page_w_el")
|
line_separator.classList.add("line_separator_page_w_el")
|
||||||
$(line_separator).insertAfter(".page_paging_elements_" + separator_iterator);
|
|
||||||
|
if (news){
|
||||||
|
if (iterator_f_check === 1){
|
||||||
|
//
|
||||||
|
} else {
|
||||||
|
$(line_separator).insertAfter(".page_paging_elements_" + separator_iterator);
|
||||||
|
separator_iterator++
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$(line_separator).insertAfter(".page_paging_elements_" + separator_iterator);
|
||||||
|
separator_iterator++
|
||||||
|
}
|
||||||
|
|
||||||
// document.querySelector(".info_profile").innerHTML = data.html;
|
// document.querySelector(".info_profile").innerHTML = data.html;
|
||||||
el.setAttribute("id",parseInt(number_last_route) + 11)
|
el.setAttribute("id",parseInt(number_last_route) + incrase)
|
||||||
history.pushState({'data':data_d,'str_data':get_url}, "state_filters", `?${get_url}`);
|
history.pushState({'data':data_d,'str_data':get_url}, "state_filters", `?${get_url}`);
|
||||||
separator_iterator++
|
|
||||||
// number_last_route = parseInt(number_last_route) + "11"
|
// number_last_route = parseInt(number_last_route) + "11"
|
||||||
|
iterator_f_check++
|
||||||
|
if (data.last_block === true){
|
||||||
|
el.classList.add("hide")
|
||||||
|
} else if (data.last_block === false){
|
||||||
|
if (el.classList.contains("hide")) {
|
||||||
|
el.classList.remove("hide")
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: function (data){
|
error: function (data){
|
||||||
|
|
||||||
|
|||||||
@@ -3,5 +3,4 @@
|
|||||||
<div class="page_paging_elements_1">
|
<div class="page_paging_elements_1">
|
||||||
{% include "blocks/articles/b_news_elements.html" %}
|
{% include "blocks/articles/b_news_elements.html" %}
|
||||||
</div>
|
</div>
|
||||||
<div class="page_paging_elements_2"></div>
|
|
||||||
<div class="clear_both"></div>
|
<div class="clear_both"></div>
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
<div class="clear_both"></div>
|
<div class="clear_both"></div>
|
||||||
|
|
||||||
{% if last_block_routes == False %}
|
{% if last_block == False %}
|
||||||
<div class="text-align-center">
|
<div class="text-align-center">
|
||||||
<button class="button-find-more-routes" id="{{ last_el }}" onclick="load_routes(this)">{% trans "Показать ещё 10" %}</button>
|
<button class="button-find-more-routes" id="{{ last_el }}" onclick="load_routes(this)">{% trans "Показать ещё 10" %}</button>
|
||||||
<div class="width-100 text-align-center mb-10">
|
<div class="width-100 text-align-center mb-10">
|
||||||
|
|||||||
@@ -33,13 +33,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="block_w_paging">
|
<div class="block_w_paging">
|
||||||
{% with from_el=3 %}
|
{% with from_el=3 %}
|
||||||
{% include 'blocks/articles/b_news_elements.html' %}
|
{% include 'blocks/articles/b_news_elements_content.html' %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{# boris edited #}
|
{# boris edited #}
|
||||||
{% if last_block == False %}
|
{% if last_block == False %}
|
||||||
<div class="text-align-center">
|
<div class="text-align-center">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<button class="button-find-more-routes" id="{{ last_el }}" onclick="load_routes(this,'news')">{% trans "Показать ещё 10" %}</button>
|
<button class="button-find-more-routes" id="{{ last_el }}" onclick="load_routes(this,'news')">{% trans "Показать ещё 2" %}</button>
|
||||||
<div class="width-100 text-align-center mb-10">
|
<div class="width-100 text-align-center mb-10">
|
||||||
<img class="loader_f_loading_routes" src="{% static "img/svg/loader.svg" %}">
|
<img class="loader_f_loading_routes" src="{% static "img/svg/loader.svg" %}">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user