Commit a1fb9e5f authored by Mat's avatar Mat

nettoie le script

parent d32d0b29
...@@ -217,7 +217,7 @@ ...@@ -217,7 +217,7 @@
} }
/* /*
* Pagenav * Pagenav, pagination par page
*/ */
let pageNav = document.querySelector('nav#pagenav ul.pagination'); let pageNav = document.querySelector('nav#pagenav ul.pagination');
...@@ -225,22 +225,18 @@ ...@@ -225,22 +225,18 @@
AJAX('GET', Routing.generate('api_membre_read_paginate'), function(request) AJAX('GET', Routing.generate('api_membre_read_paginate'), function(request)
{ {
pageNav.innerHTML = null; pageNav.innerHTML = null;
let json = JSON.parse(request.responseText); let json = JSON.parse(request.responseText);
let total = json.length; let total = json.length;
let perPage = paginate.step; let perPage = paginate.step;
//console.log('total:' + total + ' parPage:' + perPage);
if (total > perPage) if (total > perPage)
{ {
let nbPages = Math.ceil(total / perPage); let nbPages = Math.ceil(total / perPage);
//console.log(nbPages + ' pages');
currentPage = paginate.page; currentPage = paginate.page;
//console.log('page courante: '+ currentPage);
for (let i = 1; i <= nbPages; i++) for (let i = 1; i <= nbPages; i++)
{ {
//console.log(i);
let pageItem = document.createElement('li'); let pageItem = document.createElement('li');
pageItem.classList.add('page-item', (i === currentPage) ? 'active' : null); pageItem.classList.add('page-item', (i === currentPage) ? 'active' : null);
...@@ -262,9 +258,6 @@ ...@@ -262,9 +258,6 @@
} }
}); });
}); });
} }
reloadTableMembre(paginate); reloadTableMembre(paginate);
...@@ -360,7 +353,5 @@ ...@@ -360,7 +353,5 @@
}); });
}); });
</script> </script>
{% endblock %} {% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment