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
dbafcc06
Commit
dbafcc06
authored
Jul 21, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed param mutation for removeChildFilesOfTree
parent
636b2425
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
app/assets/javascripts/repo/repo_sidebar.js
app/assets/javascripts/repo/repo_sidebar.js
+3
-4
app/assets/javascripts/repo/repo_store.js
app/assets/javascripts/repo/repo_store.js
+8
-6
No files found.
app/assets/javascripts/repo/repo_sidebar.js
View file @
dbafcc06
...
...
@@ -40,12 +40,11 @@ export default class RepoSidebar {
});
},
linkClicked
(
f
ile
)
{
linkClicked
(
clickedF
ile
)
{
let
url
=
''
;
let
file
=
clickedFile
;
if
(
typeof
file
===
'
object
'
)
{
if
(
file
.
type
===
'
tree
'
&&
file
.
opened
)
{
Store
.
removeChildFilesOfTree
(
file
);
}
if
(
file
.
type
===
'
tree
'
&&
file
.
opened
)
file
=
Store
.
removeChildFilesOfTree
(
file
);
url
=
file
.
url
;
Service
.
url
=
url
;
Helper
.
getContent
(
file
);
...
...
app/assets/javascripts/repo/repo_store.js
View file @
dbafcc06
...
...
@@ -95,20 +95,22 @@ const RepoStore = {
RepoStore
.
activeFileLabel
=
'
Display source
'
;
},
/* eslint-disable no-param-reassign */
removeChildFilesOfTree
(
tree
)
{
let
foundTree
=
false
;
const
newTree
=
tree
;
RepoStore
.
files
=
RepoStore
.
files
.
filter
((
file
)
=>
{
if
(
file
.
url
===
t
ree
.
url
)
foundTree
=
true
;
if
(
file
.
url
===
newT
ree
.
url
)
foundTree
=
true
;
if
(
foundTree
)
return
file
.
level
<=
t
ree
.
level
;
if
(
foundTree
)
return
file
.
level
<=
newT
ree
.
level
;
return
true
;
});
tree
.
opened
=
false
;
tree
.
icon
=
'
fa-folder
'
;
newTree
.
opened
=
false
;
newTree
.
icon
=
'
fa-folder
'
;
return
newTree
;
},
/* eslint-enable no-param-reassign */
removeFromOpenedFiles
(
file
)
{
if
(
file
.
type
===
'
tree
'
)
return
;
...
...
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