Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
c7969568
Commit
c7969568
authored
Oct 17, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store tree list preference in localStorage
Fixed clear search button not clearing
parent
9fd5a78d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
13 deletions
+24
-13
app/assets/javascripts/diffs/components/tree_list.vue
app/assets/javascripts/diffs/components/tree_list.vue
+18
-7
locale/gitlab.pot
locale/gitlab.pot
+6
-6
No files found.
app/assets/javascripts/diffs/components/tree_list.vue
View file @
c7969568
...
@@ -5,6 +5,8 @@ import Icon from '~/vue_shared/components/icon.vue';
...
@@ -5,6 +5,8 @@ import Icon from '~/vue_shared/components/icon.vue';
import
FileRow
from
'
~/vue_shared/components/file_row.vue
'
;
import
FileRow
from
'
~/vue_shared/components/file_row.vue
'
;
import
FileRowStats
from
'
./file_row_stats.vue
'
;
import
FileRowStats
from
'
./file_row_stats.vue
'
;
const
treeListStorageKey
=
'
mr_diff_tree_list
'
;
export
default
{
export
default
{
directives
:
{
directives
:
{
Tooltip
,
Tooltip
,
...
@@ -14,9 +16,11 @@ export default {
...
@@ -14,9 +16,11 @@ export default {
FileRow
,
FileRow
,
},
},
data
()
{
data
()
{
const
treeListStored
=
localStorage
.
getItem
(
treeListStorageKey
);
return
{
return
{
search
:
''
,
search
:
''
,
renderTreeList
:
true
,
renderTreeList
:
tr
eeListStored
!==
null
?
treeListStored
===
'
true
'
:
tr
ue
,
focusSearch
:
false
,
focusSearch
:
false
,
};
};
},
},
...
@@ -42,13 +46,20 @@ export default {
...
@@ -42,13 +46,20 @@ export default {
...
mapActions
(
'
diffs
'
,
[
'
toggleTreeOpen
'
,
'
scrollToFile
'
]),
...
mapActions
(
'
diffs
'
,
[
'
toggleTreeOpen
'
,
'
scrollToFile
'
]),
clearSearch
()
{
clearSearch
()
{
this
.
search
=
''
;
this
.
search
=
''
;
this
.
toggleFocusSearch
(
false
)
},
},
toggleRenderTreeList
(
toggle
)
{
toggleRenderTreeList
(
toggle
)
{
this
.
renderTreeList
=
toggle
;
this
.
renderTreeList
=
toggle
;
localStorage
.
setItem
(
treeListStorageKey
,
this
.
renderTreeList
);
},
},
toggleFocusSearch
(
toggle
)
{
toggleFocusSearch
(
toggle
)
{
this
.
focusSearch
=
toggle
;
this
.
focusSearch
=
toggle
;
},
},
blurSearch
()
{
if
(
this
.
search
.
trim
()
===
''
)
{
this
.
toggleFocusSearch
(
false
);
}
},
},
},
FileRowStats
,
FileRowStats
,
};
};
...
@@ -68,13 +79,13 @@ export default {
...
@@ -68,13 +79,13 @@ export default {
type=
"search"
type=
"search"
class=
"form-control"
class=
"form-control"
@
focus=
"toggleFocusSearch(true)"
@
focus=
"toggleFocusSearch(true)"
@
blur=
"
toggleFocusSearch(false)
"
@
blur=
"
blurSearch
"
/>
/>
<button
<button
v-show=
"search"
v-show=
"search"
:aria-label=
"__('Clear search')"
:aria-label=
"__('Clear search')"
type=
"button"
type=
"button"
class=
"position-absolute tree-list-icon tree-list-clear-icon border-0 p-0"
class=
"position-absolute
bg-transparent
tree-list-icon tree-list-clear-icon border-0 p-0"
@
click=
"clearSearch"
@
click=
"clearSearch"
>
>
<icon
<icon
...
@@ -88,8 +99,8 @@ export default {
...
@@ -88,8 +99,8 @@ export default {
>
>
<button
<button
v-tooltip
.
hover
v-tooltip
.
hover
:aria-label=
"__('
Switch to file list
')"
:aria-label=
"__('
File view
')"
:title=
"__('
Switch to file list
')"
:title=
"__('
File view
')"
:class=
"
{
:class=
"
{
active: !renderTreeList
active: !renderTreeList
}"
}"
...
@@ -103,8 +114,8 @@ export default {
...
@@ -103,8 +114,8 @@ export default {
</button>
</button>
<button
<button
v-tooltip
.
hover
v-tooltip
.
hover
:aria-label=
"__('
Switch to tree list
')"
:aria-label=
"__('
Tree view
')"
:title=
"__('
Switch to tree list
')"
:title=
"__('
Tree view
')"
:class=
"
{
:class=
"
{
active: renderTreeList
active: renderTreeList
}"
}"
...
...
locale/gitlab.pot
View file @
c7969568
...
@@ -2783,6 +2783,9 @@ msgstr ""
...
@@ -2783,6 +2783,9 @@ msgstr ""
msgid "File templates"
msgid "File templates"
msgstr ""
msgstr ""
msgid "File view"
msgstr ""
msgid "Files"
msgid "Files"
msgstr ""
msgstr ""
...
@@ -5823,12 +5826,6 @@ msgstr ""
...
@@ -5823,12 +5826,6 @@ msgstr ""
msgid "Switch branch/tag"
msgid "Switch branch/tag"
msgstr ""
msgstr ""
msgid "Switch to file list"
msgstr ""
msgid "Switch to tree list"
msgstr ""
msgid "System Hooks"
msgid "System Hooks"
msgstr ""
msgstr ""
...
@@ -6510,6 +6507,9 @@ msgstr ""
...
@@ -6510,6 +6507,9 @@ msgstr ""
msgid "Track time with quick actions"
msgid "Track time with quick actions"
msgstr ""
msgstr ""
msgid "Tree view"
msgstr ""
msgid "Trending"
msgid "Trending"
msgstr ""
msgstr ""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment