Commit a6322b68 authored by Olav Håberg Dimmen's avatar Olav Håberg Dimmen
Browse files

Merge branch 'fix-paging-menu' into 'master'

fixed the paging menu creation

See merge request !7
parents 15c0b232 79489190
Pipeline #115433 passed with stages
in 3 minutes and 10 seconds
......@@ -49,16 +49,16 @@ function getPagingMenu(count, nextLink, prevLink){
menu += getPagingItem(nextLink.split("page=")[1],"Next");
menu += getPagingItem(Math.ceil(count/5), '»');
}
return wrapElement(wrapElement(menu,"ul","pagination"),"div");
let elem = document.createElement('div');
elem.innerHTML = wrapElement(menu,'ul','pagination');
return elem;
}
function wrapElement(element, tag, className=""){
let newElement = document.createElement(tag);
newElement.innerHTML = element;
if(className.length > 0){
newElement.className = className;
className = ' class="'+className+'"'
}
return newElement;
return '<'+tag +className+'>'+element+'</'+tag+'>';
}
function getPagingItem(parameter, inner){
......
Supports Markdown
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