From 79489190bbf60f331ba33530381400a88cc48016 Mon Sep 17 00:00:00 2001 From: olavhdi <32062632+olavhdi@users.noreply.github.com> Date: Tue, 9 Mar 2021 15:28:08 +0100 Subject: [PATCH] fixed the paging menu creation --- frontend/www/scripts/facilities.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/www/scripts/facilities.js b/frontend/www/scripts/facilities.js index c499ec3..fab6aa9 100644 --- a/frontend/www/scripts/facilities.js +++ b/frontend/www/scripts/facilities.js @@ -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+''; } function getPagingItem(parameter, inner){ -- GitLab