2019-01-24 14:48:03 +00:00
|
|
|
<script>
|
|
|
|
import { mapActions, mapGetters, mapState } from 'vuex';
|
2020-04-03 09:09:31 +00:00
|
|
|
import { GlDeprecatedButton } from '@gitlab/ui';
|
2019-01-24 14:48:03 +00:00
|
|
|
import Icon from '~/vue_shared/components/icon.vue';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
2020-04-03 09:09:31 +00:00
|
|
|
GlDeprecatedButton,
|
2019-01-24 14:48:03 +00:00
|
|
|
Icon,
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapGetters('diffs', ['isInlineView', 'isParallelView']),
|
|
|
|
...mapState('diffs', ['renderTreeList', 'showWhitespace']),
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
...mapActions('diffs', [
|
|
|
|
'setInlineDiffViewType',
|
|
|
|
'setParallelDiffViewType',
|
|
|
|
'setRenderTreeList',
|
|
|
|
'setShowWhitespace',
|
|
|
|
]),
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="dropdown">
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="btn btn-default js-show-diff-settings"
|
|
|
|
data-toggle="dropdown"
|
|
|
|
data-display="static"
|
|
|
|
>
|
2020-02-06 15:09:11 +00:00
|
|
|
<icon name="settings" /> <icon name="chevron-down" />
|
2019-01-24 14:48:03 +00:00
|
|
|
</button>
|
|
|
|
<div class="dropdown-menu dropdown-menu-right p-2 pt-3 pb-3">
|
|
|
|
<div>
|
|
|
|
<span class="bold d-block mb-1">{{ __('File browser') }}</span>
|
|
|
|
<div class="btn-group d-flex">
|
2020-04-03 09:09:31 +00:00
|
|
|
<gl-deprecated-button
|
2019-01-24 14:48:03 +00:00
|
|
|
:class="{ active: !renderTreeList }"
|
|
|
|
class="w-100 js-list-view"
|
|
|
|
@click="setRenderTreeList(false)"
|
|
|
|
>
|
|
|
|
{{ __('List view') }}
|
2020-04-03 09:09:31 +00:00
|
|
|
</gl-deprecated-button>
|
|
|
|
<gl-deprecated-button
|
2019-01-24 14:48:03 +00:00
|
|
|
:class="{ active: renderTreeList }"
|
|
|
|
class="w-100 js-tree-view"
|
|
|
|
@click="setRenderTreeList(true)"
|
|
|
|
>
|
|
|
|
{{ __('Tree view') }}
|
2020-04-03 09:09:31 +00:00
|
|
|
</gl-deprecated-button>
|
2019-01-24 14:48:03 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="mt-2">
|
|
|
|
<span class="bold d-block mb-1">{{ __('Compare changes') }}</span>
|
|
|
|
<div class="btn-group d-flex js-diff-view-buttons">
|
2020-04-03 09:09:31 +00:00
|
|
|
<gl-deprecated-button
|
2019-01-24 14:48:03 +00:00
|
|
|
id="inline-diff-btn"
|
|
|
|
:class="{ active: isInlineView }"
|
|
|
|
class="w-100 js-inline-diff-button"
|
|
|
|
data-view-type="inline"
|
|
|
|
@click="setInlineDiffViewType"
|
|
|
|
>
|
|
|
|
{{ __('Inline') }}
|
2020-04-03 09:09:31 +00:00
|
|
|
</gl-deprecated-button>
|
|
|
|
<gl-deprecated-button
|
2019-01-24 14:48:03 +00:00
|
|
|
id="parallel-diff-btn"
|
|
|
|
:class="{ active: isParallelView }"
|
|
|
|
class="w-100 js-parallel-diff-button"
|
|
|
|
data-view-type="parallel"
|
|
|
|
@click="setParallelDiffViewType"
|
|
|
|
>
|
|
|
|
{{ __('Side-by-side') }}
|
2020-04-03 09:09:31 +00:00
|
|
|
</gl-deprecated-button>
|
2019-01-24 14:48:03 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="mt-2">
|
|
|
|
<label class="mb-0">
|
|
|
|
<input
|
|
|
|
id="show-whitespace"
|
|
|
|
type="checkbox"
|
|
|
|
:checked="showWhitespace"
|
|
|
|
@change="setShowWhitespace({ showWhitespace: $event.target.checked, pushState: true })"
|
|
|
|
/>
|
|
|
|
{{ __('Show whitespace changes') }}
|
|
|
|
</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|