diff options
author | Phil Hughes <me@iamphill.com> | 2018-11-07 16:03:13 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-11-07 16:03:13 +0300 |
commit | e354a64e89bcbce64871af8d49a3515f652f4e37 (patch) | |
tree | a96e86e610ec64f340f7d834928da9710ae378d3 /app | |
parent | 2508d7b32ecc965df3009ec5f0472c0c9693697b (diff) |
Show expand all button on merge request diffs
This restores the behaviour of showing the expand all button on diffs
even when only a single file is collapsed.
Previously the button would only show when all files are collapsed.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/51737
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/diffs/components/compare_versions.vue | 6 | ||||
-rw-r--r-- | app/assets/javascripts/diffs/store/getters.js | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/assets/javascripts/diffs/components/compare_versions.vue b/app/assets/javascripts/diffs/components/compare_versions.vue index 29b5aff0fb1..a5b87dfc2d9 100644 --- a/app/assets/javascripts/diffs/components/compare_versions.vue +++ b/app/assets/javascripts/diffs/components/compare_versions.vue @@ -36,7 +36,7 @@ export default { }, computed: { ...mapState('diffs', ['commit', 'showTreeList']), - ...mapGetters('diffs', ['isInlineView', 'isParallelView', 'areAllFilesCollapsed']), + ...mapGetters('diffs', ['isInlineView', 'isParallelView', 'hasCollapsedFile']), comparableDiffs() { return this.mergeRequestDiffs.slice(1); }, @@ -113,8 +113,8 @@ export default { class="inline-parallel-buttons d-none d-md-flex ml-auto" > <a - v-if="areAllFilesCollapsed" - class="btn btn-default" + v-show="hasCollapsedFile" + class="btn btn-default append-right-8" @click="expandAllFiles" > {{ __('Expand all') }} diff --git a/app/assets/javascripts/diffs/store/getters.js b/app/assets/javascripts/diffs/store/getters.js index 2bf0ad99c22..bf490f9d78a 100644 --- a/app/assets/javascripts/diffs/store/getters.js +++ b/app/assets/javascripts/diffs/store/getters.js @@ -5,7 +5,7 @@ export const isParallelView = state => state.diffViewType === PARALLEL_DIFF_VIEW export const isInlineView = state => state.diffViewType === INLINE_DIFF_VIEW_TYPE; -export const areAllFilesCollapsed = state => state.diffFiles.every(file => file.collapsed); +export const hasCollapsedFile = state => state.diffFiles.some(file => file.collapsed); export const commitId = state => (state.commit && state.commit.id ? state.commit.id : null); |