Use href for links
This commit is contained in:
parent
cf00739074
commit
12d234adc2
@ -28,12 +28,27 @@ function appendTd(tr, content) {
|
|||||||
|
|
||||||
function appendButton(tr, content, onclick) {
|
function appendButton(tr, content, onclick) {
|
||||||
const tdRemove = document.createElement('td');
|
const tdRemove = document.createElement('td');
|
||||||
const removeButton = document.createElement('a');
|
const btn = document.createElement('button');
|
||||||
removeButton.type = 'submit';
|
|
||||||
removeButton.classList.add('btn', 'btn-primary', 'btn-fill', 'mx-auto');
|
btn.type = 'submit';
|
||||||
removeButton.appendChild(document.createTextNode(content));
|
btn.classList.add('btn', 'btn-primary', 'btn-fill', 'mx-auto');
|
||||||
removeButton.onclick = onclick;
|
btn.appendChild(document.createTextNode(content));
|
||||||
tdRemove.appendChild(removeButton);
|
btn.onclick = onclick;
|
||||||
|
|
||||||
|
tdRemove.appendChild(btn);
|
||||||
|
tr.appendChild(tdRemove);
|
||||||
|
}
|
||||||
|
|
||||||
|
function appendButtonHref(tr, content, href) {
|
||||||
|
const tdRemove = document.createElement('td');
|
||||||
|
const btn = document.createElement('a');
|
||||||
|
|
||||||
|
btn.href = href;
|
||||||
|
btn.type = 'submit';
|
||||||
|
btn.classList.add('btn', 'btn-primary', 'btn-fill', 'mx-auto');
|
||||||
|
btn.appendChild(document.createTextNode(content));
|
||||||
|
|
||||||
|
tdRemove.appendChild(btn);
|
||||||
tr.appendChild(tdRemove);
|
tr.appendChild(tdRemove);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@
|
|||||||
appendTd(tr, log.ticketid);
|
appendTd(tr, log.ticketid);
|
||||||
appendTd(tr, log.username);
|
appendTd(tr, log.username);
|
||||||
appendTd(tr, log.userid);
|
appendTd(tr, log.userid);
|
||||||
appendButton(tr, 'View', () => { location.href = '/manage/{{.guildId}}/logs/view/' + log.ticketid });
|
appendButtonHref(tr, 'View','/manage/{{.guildId}}/logs/view/' + log.ticketid);
|
||||||
|
|
||||||
container.appendChild(tr);
|
container.appendChild(tr);
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
const members = ticket.members.map(member => `${member.username}#${member.discrim}`).join(', ');
|
const members = ticket.members.map(member => `${member.username}#${member.discrim}`).join(', ');
|
||||||
appendTd(tr, members);
|
appendTd(tr, members);
|
||||||
|
|
||||||
appendButton(tr, 'View', () => { location.href = '/manage/{{.guildId}}/tickets/view/' + ticket.ticketId });
|
appendButtonHref(tr, 'View', '/manage/{{.guildId}}/tickets/view/' + ticket.ticketId);
|
||||||
|
|
||||||
container.appendChild(tr);
|
container.appendChild(tr);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user