mirror of
https://github.com/go-gitea/gitea.git
synced 2025-06-18 20:50:26 +02:00
fixed incorrect page navigation with up and down arrow on last item of dashboard repos (#34570) (#34596)
Backport #34570 by metiftikci Co-authored-by: metiftikci <metiftikci@hotmail.com>
This commit is contained in:
parent
3ace45c118
commit
c5da032193
@ -218,7 +218,9 @@ export default defineComponent({
|
|||||||
this.searchRepos();
|
this.searchRepos();
|
||||||
},
|
},
|
||||||
|
|
||||||
changePage(page: number) {
|
async changePage(page: number) {
|
||||||
|
if (this.isLoading) return;
|
||||||
|
|
||||||
this.page = page;
|
this.page = page;
|
||||||
if (this.page > this.finalPage) {
|
if (this.page > this.finalPage) {
|
||||||
this.page = this.finalPage;
|
this.page = this.finalPage;
|
||||||
@ -228,7 +230,7 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
this.repos = [];
|
this.repos = [];
|
||||||
this.counts[`${this.reposFilter}:${this.archivedFilter}:${this.privateFilter}`] = 0;
|
this.counts[`${this.reposFilter}:${this.archivedFilter}:${this.privateFilter}`] = 0;
|
||||||
this.searchRepos();
|
await this.searchRepos();
|
||||||
},
|
},
|
||||||
|
|
||||||
async searchRepos() {
|
async searchRepos() {
|
||||||
@ -298,7 +300,7 @@ export default defineComponent({
|
|||||||
return commitStatus[status].color;
|
return commitStatus[status].color;
|
||||||
},
|
},
|
||||||
|
|
||||||
reposFilterKeyControl(e: KeyboardEvent) {
|
async reposFilterKeyControl(e: KeyboardEvent) {
|
||||||
switch (e.key) {
|
switch (e.key) {
|
||||||
case 'Enter':
|
case 'Enter':
|
||||||
document.querySelector<HTMLAnchorElement>('.repo-owner-name-list li.active a')?.click();
|
document.querySelector<HTMLAnchorElement>('.repo-owner-name-list li.active a')?.click();
|
||||||
@ -307,7 +309,7 @@ export default defineComponent({
|
|||||||
if (this.activeIndex > 0) {
|
if (this.activeIndex > 0) {
|
||||||
this.activeIndex--;
|
this.activeIndex--;
|
||||||
} else if (this.page > 1) {
|
} else if (this.page > 1) {
|
||||||
this.changePage(this.page - 1);
|
await this.changePage(this.page - 1);
|
||||||
this.activeIndex = this.searchLimit - 1;
|
this.activeIndex = this.searchLimit - 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -316,17 +318,17 @@ export default defineComponent({
|
|||||||
this.activeIndex++;
|
this.activeIndex++;
|
||||||
} else if (this.page < this.finalPage) {
|
} else if (this.page < this.finalPage) {
|
||||||
this.activeIndex = 0;
|
this.activeIndex = 0;
|
||||||
this.changePage(this.page + 1);
|
await this.changePage(this.page + 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'ArrowRight':
|
case 'ArrowRight':
|
||||||
if (this.page < this.finalPage) {
|
if (this.page < this.finalPage) {
|
||||||
this.changePage(this.page + 1);
|
await this.changePage(this.page + 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'ArrowLeft':
|
case 'ArrowLeft':
|
||||||
if (this.page > 1) {
|
if (this.page > 1) {
|
||||||
this.changePage(this.page - 1);
|
await this.changePage(this.page - 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user