1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-11 17:50:57 +00:00

[v11.0/forgejo] fix(ui): show commit icon in branch dropdown button when viewing a commit (#7576)

Backport: https://codeberg.org/forgejo/forgejo/pulls/7571
Replaces https://codeberg.org/forgejo/forgejo/pulls/7574

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7576
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Co-authored-by: Beowulf <beowulf@beocode.eu>
Co-committed-by: Beowulf <beowulf@beocode.eu>
This commit is contained in:
Beowulf 2025-04-19 07:03:09 +00:00 committed by 0ko
parent 9ebdc09939
commit 722ea4179c
5 changed files with 52 additions and 25 deletions

View file

@ -54,12 +54,12 @@ const sfc = {
if (this.viewType === 'tree') {
this.isViewTree = true;
this.refNameText = this.commitIdShort;
} else if (this.viewType === 'tag') {
this.isViewTag = true;
this.refNameText = this.tagName;
} else {
} else if (this.viewType === 'branch') {
this.isViewBranch = true;
this.refNameText = this.branchName;
} else {
this.isViewTag = true;
this.refNameText = this.tagName;
}
document.body.addEventListener('click', (event) => {
@ -252,7 +252,8 @@ export default sfc; // activate IDE's Vue plugin
<template v-if="release">{{ textReleaseCompare }}</template>
<template v-else>
<svg-icon v-if="isViewTag" name="octicon-tag"/>
<svg-icon v-else name="octicon-git-branch"/>
<svg-icon v-else-if="isViewBranch" name="octicon-git-branch"/>
<svg-icon v-else name="octicon-git-commit"/>
<strong ref="dropdownRefName" class="tw-ml-2 tw-inline-block gt-ellipsis">{{ refNameText }}</strong>
</template>
</span>