feat: type tabs on create form (report/suggestion/appeal)
This commit is contained in:
@@ -10,6 +10,11 @@ const TicketCreate = {
|
|||||||
this.files = [];
|
this.files = [];
|
||||||
|
|
||||||
container.innerHTML = `
|
container.innerHTML = `
|
||||||
|
<div class="tab-nav" id="type-tabs">
|
||||||
|
<button class="${isReport?'active':''}" data-type="report">举报</button>
|
||||||
|
<button class="${isSuggestion?'active':''}" data-type="suggestion">建议</button>
|
||||||
|
<button class="${isAppeal?'active':''}" data-type="appeal">申诉</button>
|
||||||
|
</div>
|
||||||
<form id="ticket-form" enctype="multipart/form-data">
|
<form id="ticket-form" enctype="multipart/form-data">
|
||||||
<input type="hidden" name="type" value="${type}">
|
<input type="hidden" name="type" value="${type}">
|
||||||
|
|
||||||
@@ -81,6 +86,12 @@ const TicketCreate = {
|
|||||||
|
|
||||||
this.bindFileUpload(container);
|
this.bindFileUpload(container);
|
||||||
this.bindSubmit(container, type);
|
this.bindSubmit(container, type);
|
||||||
|
|
||||||
|
container.querySelectorAll('#type-tabs button').forEach(btn => {
|
||||||
|
btn.addEventListener('click', () => {
|
||||||
|
TicketCreate.render(container, { type: btn.dataset.type, prefill, backLink });
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
bindFileUpload(container) {
|
bindFileUpload(container) {
|
||||||
|
|||||||
Reference in New Issue
Block a user