2
2
import { mapActions , mapGetters , mapState } from ' vuex' ;
3
3
import { GlTooltipDirective , GlLink , GlButton } from ' @gitlab/ui' ;
4
4
import { __ } from ' ~/locale' ;
5
- import { getParameterValues , mergeUrlParams } from ' ~/lib/utils/url_utility' ;
6
5
import { polyfillSticky } from ' ~/lib/utils/sticky' ;
7
6
import Icon from ' ~/vue_shared/components/icon.vue' ;
8
7
import CompareVersionsDropdown from ' ./compare_versions_dropdown.vue' ;
8
+ import SettingsDropdown from ' ./settings_dropdown.vue' ;
9
9
10
10
export default {
11
11
components: {
12
12
CompareVersionsDropdown,
13
13
Icon,
14
14
GlLink,
15
15
GlButton,
16
+ SettingsDropdown,
16
17
},
17
18
directives: {
18
19
GlTooltip: GlTooltipDirective,
@@ -35,23 +36,10 @@ export default {
35
36
},
36
37
computed: {
37
38
... mapState (' diffs' , [' commit' , ' showTreeList' , ' startVersion' , ' latestVersionPath' ]),
38
- ... mapGetters (' diffs' , [' isInlineView ' , ' isParallelView ' , ' hasCollapsedFile' ]),
39
+ ... mapGetters (' diffs' , [' hasCollapsedFile' ]),
39
40
comparableDiffs () {
40
41
return this .mergeRequestDiffs .slice (1 );
41
42
},
42
- toggleWhitespaceText () {
43
- if (this .isWhitespaceVisible ()) {
44
- return __ (' Hide whitespace changes' );
45
- }
46
- return __ (' Show whitespace changes' );
47
- },
48
- toggleWhitespacePath () {
49
- if (this .isWhitespaceVisible ()) {
50
- return mergeUrlParams ({ w: 1 }, window .location .href );
51
- }
52
-
53
- return mergeUrlParams ({ w: 0 }, window .location .href );
54
- },
55
43
showDropdowns () {
56
44
return ! this .commit && this .mergeRequestDiffs .length ;
57
45
},
@@ -75,9 +63,6 @@ export default {
75
63
' expandAllFiles' ,
76
64
' toggleShowTreeList' ,
77
65
]),
78
- isWhitespaceVisible () {
79
- return getParameterValues (' w' )[0 ] !== ' 1' ;
80
- },
81
66
},
82
67
};
83
68
</script >
@@ -118,7 +103,7 @@ export default {
118
103
{{ __('Viewing commit') }}
119
104
<gl-link :href =" commit.commit_url" class =" monospace" >{{ commit.short_id }}</gl-link >
120
105
</div >
121
- <div class =" inline-parallel-buttons d-none d-lg -flex ml-auto" >
106
+ <div class =" inline-parallel-buttons d-none d-md -flex ml-auto" >
122
107
<gl-button
123
108
v-if =" commit || startVersion"
124
109
:href =" latestVersionPath"
@@ -129,31 +114,7 @@ export default {
129
114
<a v-show =" hasCollapsedFile" class =" btn btn-default append-right-8" @click =" expandAllFiles" >
130
115
{{ __('Expand all') }}
131
116
</a >
132
- <a :href =" toggleWhitespacePath" class =" btn btn-default qa-toggle-whitespace" >
133
- {{ toggleWhitespaceText }}
134
- </a >
135
- <div class =" btn-group prepend-left-8" >
136
- <button
137
- id =" inline-diff-btn"
138
- :class =" { active: isInlineView }"
139
- type =" button"
140
- class =" btn js-inline-diff-button"
141
- data-view-type =" inline"
142
- @click =" setInlineDiffViewType"
143
- >
144
- {{ __('Inline') }}
145
- </button >
146
- <button
147
- id =" parallel-diff-btn"
148
- :class =" { active: isParallelView }"
149
- type =" button"
150
- class =" btn js-parallel-diff-button"
151
- data-view-type =" parallel"
152
- @click =" setParallelDiffViewType"
153
- >
154
- {{ __('Side-by-side') }}
155
- </button >
156
- </div >
117
+ <settings-dropdown />
157
118
</div >
158
119
</div >
159
120
</div >
0 commit comments