mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-25 20:18:38 +02:00
wip
This commit is contained in:
commit
f5b6289e18
2 changed files with 12 additions and 6 deletions
|
@ -925,9 +925,9 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||||
initializeTooltips();
|
initializeTooltips();
|
||||||
|
|
||||||
updatePagination(data.page, data.num_pages, data.has_previous, data.has_next);
|
updatePagination(data.page, data.num_pages, data.has_previous, data.has_next);
|
||||||
currentPage = page;
|
currentPage = page;
|
||||||
currentSortBy = sortBy;
|
currentSortBy = sortBy;
|
||||||
currentOrder = order;
|
currentOrder = order;
|
||||||
})
|
})
|
||||||
.catch(error => console.error('Error fetching domains:', error));
|
.catch(error => console.error('Error fetching domains:', error));
|
||||||
}
|
}
|
||||||
|
@ -988,7 +988,10 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||||
document.querySelectorAll('.dotgov-table th[data-sortable]').forEach(header => {
|
document.querySelectorAll('.dotgov-table th[data-sortable]').forEach(header => {
|
||||||
header.addEventListener('click', function() {
|
header.addEventListener('click', function() {
|
||||||
const sortBy = this.getAttribute('data-sortable');
|
const sortBy = this.getAttribute('data-sortable');
|
||||||
const order = currentOrder === 'asc' ? 'desc' : 'asc';
|
let order = 'asc';
|
||||||
|
if (sortBy === currentSortBy) {
|
||||||
|
order = currentOrder === 'asc' ? 'desc' : 'asc';
|
||||||
|
}
|
||||||
loadPage(1, sortBy, order);
|
loadPage(1, sortBy, order);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1132,7 +1135,10 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||||
document.querySelectorAll('.dotgov-table__domain-requests th[data-sortable]').forEach(header => {
|
document.querySelectorAll('.dotgov-table__domain-requests th[data-sortable]').forEach(header => {
|
||||||
header.addEventListener('click', function() {
|
header.addEventListener('click', function() {
|
||||||
const sortBy = this.getAttribute('data-sortable');
|
const sortBy = this.getAttribute('data-sortable');
|
||||||
const order = currentOrder === 'asc' ? 'desc' : 'asc';
|
let order = 'asc';
|
||||||
|
if (sortBy === currentSortBy) {
|
||||||
|
order = currentOrder === 'asc' ? 'desc' : 'asc';
|
||||||
|
}
|
||||||
loadDomainRequestsPage(1, sortBy, order);
|
loadDomainRequestsPage(1, sortBy, order);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
<caption class="sr-only">Your domain requests</caption>
|
<caption class="sr-only">Your domain requests</caption>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th data-sortable="requested_domain" scope="col" role="columnheader">Domain name</th>
|
<th data-sortable="name" scope="col" role="columnheader">Domain name</th>
|
||||||
<th data-sortable="submission_date" scope="col" role="columnheader">Date submitted</th>
|
<th data-sortable="submission_date" scope="col" role="columnheader">Date submitted</th>
|
||||||
<th data-sortable="status" scope="col" role="columnheader">Status</th>
|
<th data-sortable="status" scope="col" role="columnheader">Status</th>
|
||||||
<th scope="col" role="columnheader"><span class="usa-sr-only">Action</span></th>
|
<th scope="col" role="columnheader"><span class="usa-sr-only">Action</span></th>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue