summaryrefslogtreecommitdiffstats
path: root/web_src/js/components
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2023-01-13 09:29:10 +0000
committerGitHub <noreply@github.com>2023-01-13 17:29:10 +0800
commit421d87933b8fc6dc1cc151b875f94c349b58299f (patch)
tree50d37469a9081c7210b05828ecc0100226fa2007 /web_src/js/components
parent426c0ad14c5edc6b7afdf7386d71889732ca11ac (diff)
downloadgitea-421d87933b8fc6dc1cc151b875f94c349b58299f.tar.gz
gitea-421d87933b8fc6dc1cc151b875f94c349b58299f.zip
Restore function to "Show more" buttons (#22399) (#22426)
Backport #22399 There was a serious regression in #21012 which broke the Show More button on the diff page, and the show more button was also broken on the file tree too. This PR fixes this by resetting the pageData.diffFiles as the vue watched value and reattachs a function to the show more button outside of the file tree view. Fix #22380 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'web_src/js/components')
-rw-r--r--web_src/js/components/DiffFileTree.vue5
1 files changed, 4 insertions, 1 deletions
diff --git a/web_src/js/components/DiffFileTree.vue b/web_src/js/components/DiffFileTree.vue
index 717ba70f7f..71013f08ee 100644
--- a/web_src/js/components/DiffFileTree.vue
+++ b/web_src/js/components/DiffFileTree.vue
@@ -8,7 +8,7 @@
<DiffFileTreeItem v-for="item in fileTree" :key="item.name" :item="item" />
</div>
<div v-if="isIncomplete" id="diff-too-many-files-stats" class="pt-2">
- <span>{{ tooManyFilesMessage }}</span><a :class="['ui', 'basic', 'tiny', 'button', isLoadingNewData === true ? 'disabled' : '']" id="diff-show-more-files-stats" @click.stop="loadMoreData">{{ showMoreMessage }}</a>
+ <span class="mr-2">{{ tooManyFilesMessage }}</span><a :class="['ui', 'basic', 'tiny', 'button', isLoadingNewData === true ? 'disabled' : '']" id="diff-show-more-files-stats" @click.stop="loadMoreData">{{ showMoreMessage }}</a>
</div>
</div>
</template>
@@ -98,6 +98,9 @@ export default {
mounted() {
// ensure correct buttons when we are mounted to the dom
this.adjustToggleButton(this.fileTreeIsVisible);
+ // replace the pageData.diffFileInfo.files with our watched data so we get updates
+ pageData.diffFileInfo.files = this.files;
+
document.querySelector('.diff-toggle-file-tree-button').addEventListener('click', this.toggleVisibility);
},
unmounted() {