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
c2e34bab
Commit
c2e34bab
authored
Jun 27, 2017
by
Jacob Schatz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds popstate
parent
d04f4a9b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
3 deletions
+52
-3
app/assets/javascripts/repo/repo_file.js
app/assets/javascripts/repo/repo_file.js
+7
-2
app/assets/javascripts/repo/repo_sidebar.js
app/assets/javascripts/repo/repo_sidebar.js
+12
-0
app/assets/stylesheets/framework/variables.scss
app/assets/stylesheets/framework/variables.scss
+1
-0
app/assets/stylesheets/pages/repo.scss
app/assets/stylesheets/pages/repo.scss
+29
-0
app/views/projects/tree/_tree_content.html.haml
app/views/projects/tree/_tree_content.html.haml
+3
-1
No files found.
app/assets/javascripts/repo/repo_file.js
View file @
c2e34bab
let
RepoFile
=
{
let
RepoFile
=
{
template
:
`
template
:
`
<li>
<li>
<i class='fa' :class='file.icon'></i>
<div class='col-md-4'>
<a :href='file.url' @click.prevent='linkClicked(file)'>{{file.name}}</a>
<i class='fa' :class='file.icon'></i>
<a :href='file.url' @click.prevent='linkClicked(file)'>{{file.name}}</a>
</div>
<div class="col-md-4">
<span>{{JSON.stringify(file)}}</span>
</div>
</li>
</li>
`
,
`
,
props
:
{
props
:
{
...
...
app/assets/javascripts/repo/repo_sidebar.js
View file @
c2e34bab
...
@@ -18,9 +18,21 @@ export default class RepoSidebar {
...
@@ -18,9 +18,21 @@ export default class RepoSidebar {
'
repo-file
'
:
RepoFile
,
'
repo-file
'
:
RepoFile
,
},
},
created
()
{
this
.
addPopEventListener
();
},
data
:
()
=>
Store
,
data
:
()
=>
Store
,
methods
:
{
methods
:
{
addPopEventListener
()
{
window
.
addEventListener
(
'
popstate
'
,
()
=>
{
this
.
linkClicked
({
url
:
location
.
href
});
});
},
linkClicked
(
file
)
{
linkClicked
(
file
)
{
Service
.
url
=
file
.
url
;
Service
.
url
=
file
.
url
;
Helper
.
getContent
();
Helper
.
getContent
();
...
...
app/assets/stylesheets/framework/variables.scss
View file @
c2e34bab
...
@@ -76,6 +76,7 @@ $red-900: #711e11;
...
@@ -76,6 +76,7 @@ $red-900: #711e11;
$black
:
#000
;
$black
:
#000
;
$black-transparent
:
rgba
(
0
,
0
,
0
,
0
.3
);
$black-transparent
:
rgba
(
0
,
0
,
0
,
0
.3
);
$almost-black
:
#242424
;
$border-white-light
:
darken
(
$white-light
,
$darken-border-factor
);
$border-white-light
:
darken
(
$white-light
,
$darken-border-factor
);
$border-white-normal
:
darken
(
$white-normal
,
$darken-border-factor
);
$border-white-normal
:
darken
(
$white-normal
,
$darken-border-factor
);
...
...
app/assets/stylesheets/pages/repo.scss
View file @
c2e34bab
...
@@ -2,6 +2,25 @@
...
@@ -2,6 +2,25 @@
display
:
none
;
display
:
none
;
}
}
.fade-enter-active
,
.fade-leave-active
{
transition
:
opacity
.5s
}
.fade-enter
,
.fade-leave-to
/*
.fade-leave-active
in
<
2
.1.8
*/
{
opacity
:
0
}
.tree-content-holder
{
border
:
1px
solid
$border-color
;
border-radius
:
$border-radius-default
;
color
:
$almost-black
;
header
{
background
:
$gray-light
;
padding
:
10px
25px
;
border-bottom
:
1px
solid
$border-color
;
font-size
:
$code_font_size
;
}
#sidebar
{
#sidebar
{
ul
{
ul
{
list-style-type
:
none
;
list-style-type
:
none
;
...
@@ -9,6 +28,16 @@
...
@@ -9,6 +28,16 @@
li
{
li
{
border-bottom
:
1px
solid
$border-gray-normal
;
border-bottom
:
1px
solid
$border-gray-normal
;
padding
:
10px
20px
;
padding
:
10px
20px
;
a
{
color
:
$almost-black
;
}
.fa
{
font-size
:
$code_font_size
;
margin-right
:
5px
;
}
}
}
}
}
}
}
}
\ No newline at end of file
app/views/projects/tree/_tree_content.html.haml
View file @
c2e34bab
.tree-content-holder
.tree-content-holder
%header
Project
#sidebar
#sidebar
%ul
%ul
%repo-file
{
"v-for"
=>
"file in files
"
,
":file"
=>
"file"
,
"@linkclicked"
=>
"linkClicked(file)"
}
%repo-file
{
"v-for"
=>
"file in files"
,
":key"
=>
"file.id
"
,
":file"
=>
"file"
,
"@linkclicked"
=>
"linkClicked(file)"
}
#ide
{
data:
{
url:
repo_url
},
style:
"height:400px;"
}
#ide
{
data:
{
url:
repo_url
},
style:
"height:400px;"
}
-
if
tree
.
readme
-
if
tree
.
readme
...
...
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