1
0
mirror of https://github.com/oupala/apaxy.git synced 2025-08-07 14:36:42 +02:00

fix: invalid links from the root folder

This commit is contained in:
Aleksandr Kliushenok
2018-03-10 11:15:26 +03:00
committed by oupala
parent 73e44c7852
commit 04b185d702

View File

@@ -2,11 +2,11 @@
document.getElementsByTagName('tr')[1].className = 'parent';
// fix links when not adding a / at the end of the URI
var uri = window.location.pathname.substr(1);
if (uri.substring(uri.length - 1) != '/') {
if (uri.substring(uri.length - 1) !== '/') {
var indexes = document.getElementsByClassName('indexcolname');
var i = indexes.length;
while (i--) {
while (i) {
var a = indexes[i].getElementsByTagName('a')[0];
a.href = '/' + uri + '/' + a.getAttribute('href', 2);
a.href = '/' + a.getAttribute('href', 2);
}
}