Fix up not being able to go past 7 with pagnation
Cette révision appartient à :
Parent
c7561fd5b9
révision
7a49644844
1 fichiers modifiés avec 13 ajouts et 9 suppressions
22
index.html
22
index.html
|
@ -94,7 +94,6 @@
|
|||
var pathArray = window.location.pathname.split( '/' );
|
||||
var query = window.location.search;
|
||||
var page = parseInt(pathArray[2]);
|
||||
console.log(query);
|
||||
var pageString;
|
||||
|
||||
var next = page+1;
|
||||
|
@ -102,36 +101,41 @@
|
|||
if (prev < 1) {
|
||||
prev = 1;
|
||||
}
|
||||
if (isNaN(page)) {
|
||||
|
||||
if (!isNaN(page)) {
|
||||
next = 2;
|
||||
prev = 1;
|
||||
pageString = "/page/";
|
||||
|
||||
}
|
||||
if (query != "") {
|
||||
next = 2;
|
||||
prev = 1;
|
||||
pageString = "/search/";
|
||||
}
|
||||
|
||||
var one = next+1;
|
||||
var two = next+2;
|
||||
var three = next+3;
|
||||
var four = next+4;
|
||||
var five = next+5;
|
||||
document.getElementById("One").href= pageString + one + query;
|
||||
document.getElementById("One").href= pageString + one.toString() + query;
|
||||
document.getElementById("One").innerHTML = one.toString();
|
||||
document.getElementById("Two").href= pageString +two + query;
|
||||
document.getElementById("Two").innerHTML = two.toString();
|
||||
|
||||
document.getElementById("Three").href= pageString +three + query;
|
||||
document.getElementById("Three").href= pageString +three.toString() + query;
|
||||
document.getElementById("Three").innerHTML = three.toString();
|
||||
|
||||
document.getElementById("Four").href= pageString +four + query;
|
||||
document.getElementById("Four").href= pageString +four.toString() + query;
|
||||
document.getElementById("Four").innerHTML = four.toString();
|
||||
|
||||
document.getElementById("Five").href= pageString +five + query;
|
||||
document.getElementById("Five").href= pageString +five.toString() + query;
|
||||
document.getElementById("Five").innerHTML = five.toString();
|
||||
|
||||
document.getElementById("Next").href = pageString +next + query;
|
||||
document.getElementById("Prev").href = pageString +prev + query;
|
||||
document.getElementById("Next").href = pageString +next.toString() + query;
|
||||
document.getElementById("Prev").href = pageString +prev.toString() + query;
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Référencer dans un nouveau ticket