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 {
...
@@ -40,12 +40,11 @@ export default class RepoSidebar {
});
});
},
},
linkClicked
(
f
ile
)
{
linkClicked
(
clickedF
ile
)
{
let
url
=
''
;
let
url
=
''
;
let
file
=
clickedFile
;
if
(
typeof
file
===
'
object
'
)
{
if
(
typeof
file
===
'
object
'
)
{
if
(
file
.
type
===
'
tree
'
&&
file
.
opened
)
{
if
(
file
.
type
===
'
tree
'
&&
file
.
opened
)
file
=
Store
.
removeChildFilesOfTree
(
file
);
Store
.
removeChildFilesOfTree
(
file
);
}
url
=
file
.
url
;
url
=
file
.
url
;
Service
.
url
=
url
;
Service
.
url
=
url
;
Helper
.
getContent
(
file
);
Helper
.
getContent
(
file
);
...
...
app/assets/javascripts/repo/repo_store.js
View file @
dbafcc06
...
@@ -95,20 +95,22 @@ const RepoStore = {
...
@@ -95,20 +95,22 @@ const RepoStore = {
RepoStore
.
activeFileLabel
=
'
Display source
'
;
RepoStore
.
activeFileLabel
=
'
Display source
'
;
},
},
/* eslint-disable no-param-reassign */
removeChildFilesOfTree
(
tree
)
{
removeChildFilesOfTree
(
tree
)
{
let
foundTree
=
false
;
let
foundTree
=
false
;
const
newTree
=
tree
;
RepoStore
.
files
=
RepoStore
.
files
.
filter
((
file
)
=>
{
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
;
return
true
;
});
});
tree
.
opened
=
false
;
newTree
.
opened
=
false
;
tree
.
icon
=
'
fa-folder
'
;
newTree
.
icon
=
'
fa-folder
'
;
return
newTree
;
},
},
/* eslint-enable no-param-reassign */
removeFromOpenedFiles
(
file
)
{
removeFromOpenedFiles
(
file
)
{
if
(
file
.
type
===
'
tree
'
)
return
;
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