Skip to content

Commit

Permalink
Moved some functionality into its own func
Browse files Browse the repository at this point in the history
  • Loading branch information
shivan2418 committed Oct 28, 2019
1 parent f0c0e7c commit f8a8e49
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
// select all the students by getting all the children of the student list div
const student_list = document.querySelector('.student-list').children;
const items_per_page = 10;
// calculate how many nav buttons are needed, use the rounded up number.
const num_navbuttons = Math.ceil(student_list.length / items_per_page);

// Create theh pagination buttons
appendPageLinks();
Expand Down Expand Up @@ -53,7 +51,9 @@ function updateButtons(event) {

function appendPageLinks() {
console.log('page func');
let navbuttons = [];
// calculate how many nav buttons are needed, use the rounded up number.
const num_navbuttons = Math.ceil(student_list.length / items_per_page);

let pagination_div = document.querySelector('.pagination');

// iteate and create buttons as needed.
Expand Down

0 comments on commit f8a8e49

Please sign in to comment.