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) {
|
||||
const tdRemove = document.createElement('td');
|
||||
const removeButton = document.createElement('a');
|
||||
removeButton.type = 'submit';
|
||||
removeButton.classList.add('btn', 'btn-primary', 'btn-fill', 'mx-auto');
|
||||
removeButton.appendChild(document.createTextNode(content));
|
||||
removeButton.onclick = onclick;
|
||||
tdRemove.appendChild(removeButton);
|
||||
const btn = document.createElement('button');
|
||||
|
||||
btn.type = 'submit';
|
||||
btn.classList.add('btn', 'btn-primary', 'btn-fill', 'mx-auto');
|
||||
btn.appendChild(document.createTextNode(content));
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@
|
||||
appendTd(tr, log.ticketid);
|
||||
appendTd(tr, log.username);
|
||||
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);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@
|
||||
const members = ticket.members.map(member => `${member.username}#${member.discrim}`).join(', ');
|
||||
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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user