client/public/elements/components/pagination.js
/**
     * @function addPages
     * @description private function for _constructCenterPageArray that builds the pages array
     * @param {Number} loops - Number of pages to be added on either side of the pages array
     */
@function addPages
@description private function for _constructCenterPageArray that builds the pages array
@param {Number} loops - Number of pages to be added on either side of the pages array
@function addPages @description private function for _constructCenterPageArray that builds the pages array @param { Number } loops - Number of pages to be added on either side of the pages array
function addPages(loops){
      let directions = ['left', 'right'];
      for (let direction of directions) {
        if (direction === 'left') {
          for (let i = 0; i < loops; i++) {
            let first = pages[0].page;
            if (first > self.minPage) {
              pages.unshift({page: first - 1, selected: false});
              remainder -= 1;
            }
          }
        }
        if (direction === 'right') {
          for (let i = 0; i < loops; i++) {
            let last = pages.slice(-1)[0].page;
            if (last < self.maxPage) {
              pages.push({page: last + 1, selected: false});
              remainder -= 1;
            }
          }
        }
      }
    }
function addPages ( loops ) { let directions = [ 'left' , 'right' ] ; for ( let direction of directions ) { if ( direction === 'left' ) { for ( let i = 0 ; i < loops ; i ++ ) { let first = pages [ 0 ] . page ; if ( first > self . minPage ) { pages . unshift ( { page : first - 1 , selected : false } ) ; remainder -= 1 ; } } } if ( direction === 'right' ) { for ( let i = 0 ; i < loops ; i ++ ) { let last = pages . slice ( - 1 ) [ 0 ] . page ; if ( last < self . maxPage ) { pages . push ( { page : last + 1 , selected : false } ) ; remainder -= 1 ; } } } } }
@function addPages
 @description private function for _constructCenterPageArray that builds the pages array
 @param {Number} loops - Number of pages to be added on either side of the pages array
@function addPages @description private function for _constructCenterPageArray that builds the pages array @param { Number } loops - Number of pages to be added on either side of the pages array