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
ebec90a0
Commit
ebec90a0
authored
Jun 29, 2017
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds back button.
parent
6190c39e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
13 deletions
+18
-13
app/assets/javascripts/repo/repo_helper.js
app/assets/javascripts/repo/repo_helper.js
+2
-0
app/assets/javascripts/repo/repo_prev_directory.js
app/assets/javascripts/repo/repo_prev_directory.js
+2
-2
app/assets/javascripts/repo/repo_sidebar.js
app/assets/javascripts/repo/repo_sidebar.js
+8
-6
app/assets/javascripts/repo/repo_store.js
app/assets/javascripts/repo/repo_store.js
+1
-0
app/views/projects/tree/_tree_content.html.haml
app/views/projects/tree/_tree_content.html.haml
+5
-5
No files found.
app/assets/javascripts/repo/repo_helper.js
View file @
ebec90a0
...
@@ -46,6 +46,7 @@ let RepoHelper = {
...
@@ -46,6 +46,7 @@ let RepoHelper = {
// it's a blob
// it's a blob
const
parentURL
=
this
.
blobURLtoParent
(
Service
.
url
);
const
parentURL
=
this
.
blobURLtoParent
(
Service
.
url
);
Store
.
blobRaw
=
data
.
plain
;
Store
.
blobRaw
=
data
.
plain
;
Store
.
prevURL
=
this
.
blobURLtoParent
(
parentURL
);
Service
.
getContent
(
parentURL
)
Service
.
getContent
(
parentURL
)
.
then
((
response
)
=>
{
.
then
((
response
)
=>
{
Store
.
files
=
this
.
dataToListOfFiles
(
response
.
data
);
Store
.
files
=
this
.
dataToListOfFiles
(
response
.
data
);
...
@@ -56,6 +57,7 @@ let RepoHelper = {
...
@@ -56,6 +57,7 @@ let RepoHelper = {
}
else
{
}
else
{
// it's a tree
// it's a tree
Store
.
files
=
this
.
dataToListOfFiles
(
data
);
Store
.
files
=
this
.
dataToListOfFiles
(
data
);
Store
.
prevURL
=
this
.
blobURLtoParent
(
Service
.
url
);
}
}
})
})
.
catch
((
response
)
=>
{
.
catch
((
response
)
=>
{
...
...
app/assets/javascripts/repo/repo_prev_directory.js
View file @
ebec90a0
...
@@ -2,17 +2,17 @@ let RepoPreviousDirectory = {
...
@@ -2,17 +2,17 @@ let RepoPreviousDirectory = {
template
:
`
template
:
`
<tr>
<tr>
<td colspan='3'>
<td colspan='3'>
<a
href='#' @click.prevent='linkClicked("prev"
)'>..</a>
<a
:href='prevurl' @click.prevent='linkClicked(prevurl
)'>..</a>
</td>
</td>
</tr>
</tr>
`
,
`
,
props
:
{
props
:
{
name
:
'
repo-previous-directory
'
,
name
:
'
repo-previous-directory
'
,
prevurl
:
String
},
},
methods
:
{
methods
:
{
linkClicked
(
file
)
{
linkClicked
(
file
)
{
console
.
log
(
this
.
isTree
)
this
.
$emit
(
'
linkclicked
'
,
file
);
this
.
$emit
(
'
linkclicked
'
,
file
);
}
}
}
}
...
...
app/assets/javascripts/repo/repo_sidebar.js
View file @
ebec90a0
...
@@ -37,14 +37,16 @@ export default class RepoSidebar {
...
@@ -37,14 +37,16 @@ export default class RepoSidebar {
},
},
linkClicked
(
file
)
{
linkClicked
(
file
)
{
if
(
file
===
'
prev
'
){
let
url
=
''
;
if
(
typeof
file
===
'
string
'
){
// go back
url
=
file
;
}
else
{
}
else
{
Service
.
url
=
file
.
url
;
url
=
file
.
url
;
Helper
.
getContent
();
Helper
.
toURL
(
file
.
url
);
}
}
Service
.
url
=
url
;
Helper
.
getContent
();
Helper
.
toURL
(
url
);
}
}
},
},
});
});
...
...
app/assets/javascripts/repo/repo_store.js
View file @
ebec90a0
...
@@ -3,6 +3,7 @@ let RepoStore = {
...
@@ -3,6 +3,7 @@ let RepoStore = {
editor
:
''
,
editor
:
''
,
sidebar
:
''
,
sidebar
:
''
,
isTree
:
false
,
isTree
:
false
,
prevURL
:
''
,
trees
:
[],
trees
:
[],
blobs
:
[],
blobs
:
[],
submodules
:
[],
submodules
:
[],
...
...
app/views/projects/tree/_tree_content.html.haml
View file @
ebec90a0
.tree-content-holder
.tree-content-holder
%header
#sidebar
{
":class"
=>
"{'sidebar-mini' : !isTree}"
}
<
Project
#sidebar
.isworking
{
":class"
=>
"{'sidebar-mini' : !isTree}"
}
<
%table
.table
%table
.table
%thead
{
"v-if"
=>
"isTree"
}
%thead
{
"v-if"
=>
"isTree"
}
%th
%th
{
"v-if"
=>
"isTree"
}
Name
Name
%th
{
"v-else"
}
Project
%th
{
"v-if"
=>
"isTree"
}
%th
{
"v-if"
=>
"isTree"
}
Last
Commit
Last
Commit
%th
{
"v-if"
=>
"isTree"
}
%th
{
"v-if"
=>
"isTree"
}
Last
Update
Last
Update
%tr
{
is:
"repo-previous-directory"
}
%tr
{
is:
"repo-previous-directory"
,
":prevurl"
=>
"prevURL"
,
"@linkclicked"
=>
"linkClicked"
}
%tr
{
is:
"repo-file"
,
"v-for"
=>
"file in files"
,
":key"
=>
"file.id"
,
":file"
=>
"file"
,
"@linkclicked"
=>
"linkClicked(file)"
,
":is-tree"
=>
"isTree"
}
%tr
{
is:
"repo-file"
,
"v-for"
=>
"file in files"
,
":key"
=>
"file.id"
,
":file"
=>
"file"
,
"@linkclicked"
=>
"linkClicked(file)"
,
":is-tree"
=>
"isTree"
}
#ide
{
data:
{
url:
repo_url
},
style:
"height:400px;"
}
>
#ide
{
data:
{
url:
repo_url
},
style:
"height:400px;"
}
>
...
...
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