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
Jérome Perrin
gitlab-ce
Commits
7216a1f1
Commit
7216a1f1
authored
Jun 30, 2017
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove children when closing folder.
parent
8f4850e1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
6 deletions
+31
-6
app/assets/javascripts/repo/repo_bundle.js
app/assets/javascripts/repo/repo_bundle.js
+0
-1
app/assets/javascripts/repo/repo_file.js
app/assets/javascripts/repo/repo_file.js
+0
-1
app/assets/javascripts/repo/repo_helper.js
app/assets/javascripts/repo/repo_helper.js
+27
-2
app/assets/javascripts/repo/repo_mini_mixin.js
app/assets/javascripts/repo/repo_mini_mixin.js
+0
-1
app/assets/javascripts/repo/repo_sidebar.js
app/assets/javascripts/repo/repo_sidebar.js
+4
-1
No files found.
app/assets/javascripts/repo/repo_bundle.js
View file @
7216a1f1
...
@@ -7,7 +7,6 @@ import Helper from './repo_helper'
...
@@ -7,7 +7,6 @@ import Helper from './repo_helper'
export
default
class
RepoBundle
{
export
default
class
RepoBundle
{
constructor
()
{
constructor
()
{
console
.
log
(
document
.
getElementById
(
'
ide
'
))
const
url
=
document
.
getElementById
(
'
ide
'
).
dataset
.
url
;
const
url
=
document
.
getElementById
(
'
ide
'
).
dataset
.
url
;
Store
.
service
=
Service
;
Store
.
service
=
Service
;
Store
.
service
.
url
=
url
;
Store
.
service
.
url
=
url
;
...
...
app/assets/javascripts/repo/repo_file.js
View file @
7216a1f1
...
@@ -22,7 +22,6 @@ let RepoFile = {
...
@@ -22,7 +22,6 @@ let RepoFile = {
methods
:
{
methods
:
{
linkClicked
(
file
)
{
linkClicked
(
file
)
{
console
.
log
(
this
.
isTree
)
this
.
$emit
(
'
linkclicked
'
,
file
);
this
.
$emit
(
'
linkclicked
'
,
file
);
}
}
}
}
...
...
app/assets/javascripts/repo/repo_helper.js
View file @
7216a1f1
...
@@ -84,6 +84,13 @@ let RepoHelper = {
...
@@ -84,6 +84,13 @@ let RepoHelper = {
}
}
},
},
setDirectoryOpen
(
tree
)
{
if
(
tree
)
{
tree
.
opened
=
true
;
tree
.
icon
=
'
fa-folder-open
'
;
}
},
// may be tree or file.
// may be tree or file.
getContent
(
file
)
{
getContent
(
file
)
{
Service
.
getContent
()
Service
.
getContent
()
...
@@ -98,9 +105,9 @@ let RepoHelper = {
...
@@ -98,9 +105,9 @@ let RepoHelper = {
data
.
url
=
file
.
url
;
data
.
url
=
file
.
url
;
this
.
addToOpenedFiles
(
data
);
this
.
addToOpenedFiles
(
data
);
this
.
setActiveFile
(
data
);
this
.
setActiveFile
(
data
);
console
.
log
(
data
);
}
else
{
}
else
{
// it's a tree
// it's a tree
this
.
setDirectoryOpen
(
file
);
let
newDirectory
=
this
.
dataToListOfFiles
(
data
);
let
newDirectory
=
this
.
dataToListOfFiles
(
data
);
Store
.
files
=
this
.
insertNewFilesIntoParentDir
(
file
,
Store
.
files
,
newDirectory
);
Store
.
files
=
this
.
insertNewFilesIntoParentDir
(
file
,
Store
.
files
,
newDirectory
);
Store
.
prevURL
=
this
.
blobURLtoParent
(
Service
.
url
);
Store
.
prevURL
=
this
.
blobURLtoParent
(
Service
.
url
);
...
@@ -112,7 +119,25 @@ let RepoHelper = {
...
@@ -112,7 +119,25 @@ let RepoHelper = {
},
},
toFA
(
icon
)
{
toFA
(
icon
)
{
return
`fa-
${
icon
}
`
return
`fa-
${
icon
}
`
;
},
removeChildFilesOfTree
(
tree
)
{
let
foundTree
=
false
;
Store
.
files
=
Store
.
files
.
filter
((
file
)
=>
{
if
(
file
.
url
===
tree
.
url
)
{
foundTree
=
true
;
}
if
(
foundTree
)
{
return
file
.
level
<=
tree
.
level
}
else
{
return
true
;
}
});
tree
.
opened
=
false
;
tree
.
icon
=
'
fa-folder
'
;
},
},
dataToListOfFiles
(
data
)
{
dataToListOfFiles
(
data
)
{
...
...
app/assets/javascripts/repo/repo_mini_mixin.js
View file @
7216a1f1
...
@@ -3,7 +3,6 @@ import Store from './repo_store'
...
@@ -3,7 +3,6 @@ import Store from './repo_store'
let
RepoMiniMixin
=
{
let
RepoMiniMixin
=
{
computed
:
{
computed
:
{
isMini
()
{
isMini
()
{
console
.
log
(
'
checking
'
,
Store
.
openedFiles
.
length
)
return
!!
Store
.
openedFiles
.
length
;
return
!!
Store
.
openedFiles
.
length
;
}
}
},
},
...
...
app/assets/javascripts/repo/repo_sidebar.js
View file @
7216a1f1
...
@@ -11,7 +11,6 @@ export default class RepoSidebar {
...
@@ -11,7 +11,6 @@ export default class RepoSidebar {
this
.
url
=
url
;
this
.
url
=
url
;
this
.
initVue
();
this
.
initVue
();
this
.
el
=
document
.
getElementById
(
'
ide
'
);
this
.
el
=
document
.
getElementById
(
'
ide
'
);
console
.
log
(
document
.
getElementById
(
'
sidebar
'
))
}
}
initVue
()
{
initVue
()
{
...
@@ -48,6 +47,10 @@ export default class RepoSidebar {
...
@@ -48,6 +47,10 @@ export default class RepoSidebar {
}
}
Service
.
url
=
url
;
Service
.
url
=
url
;
if
(
typeof
file
===
'
object
'
)
{
if
(
typeof
file
===
'
object
'
)
{
if
(
file
.
type
===
'
tree
'
&&
file
.
opened
)
{
Helper
.
removeChildFilesOfTree
(
file
);
return
;
}
Helper
.
getContent
(
file
);
Helper
.
getContent
(
file
);
}
}
}
}
...
...
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