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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
e4412799
Commit
e4412799
authored
Sep 26, 2017
by
Tim Zallmann
Committed by
Douwe Maan
Sep 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Page Title setting for files + directories
parent
711bb285
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
app/assets/javascripts/repo/helpers/repo_helper.js
app/assets/javascripts/repo/helpers/repo_helper.js
+5
-3
app/assets/javascripts/repo/stores/repo_store.js
app/assets/javascripts/repo/stores/repo_store.js
+1
-1
No files found.
app/assets/javascripts/repo/helpers/repo_helper.js
View file @
e4412799
...
...
@@ -58,13 +58,13 @@ const RepoHelper = {
return
langs
.
find
(
lang
=>
lang
.
extensions
&&
lang
.
extensions
.
indexOf
(
`.
${
ext
}
`
)
>
-
1
);
},
setDirectoryOpen
(
tree
)
{
setDirectoryOpen
(
tree
,
title
)
{
const
file
=
tree
;
if
(
!
file
)
return
undefined
;
file
.
opened
=
true
;
file
.
icon
=
'
fa-folder-open
'
;
RepoHelper
.
updateHistoryEntry
(
file
.
url
,
file
.
nam
e
);
RepoHelper
.
updateHistoryEntry
(
file
.
url
,
titl
e
);
return
file
;
},
...
...
@@ -135,6 +135,8 @@ const RepoHelper = {
return
Service
.
getContent
()
.
then
((
response
)
=>
{
const
data
=
response
.
data
;
if
(
response
.
headers
&&
response
.
headers
[
'
page-title
'
])
data
.
pageTitle
=
response
.
headers
[
'
page-title
'
];
Store
.
isTree
=
RepoHelper
.
isTree
(
data
);
if
(
!
Store
.
isTree
)
{
if
(
!
file
)
file
=
data
;
...
...
@@ -168,7 +170,7 @@ const RepoHelper = {
}
else
{
// it's a tree
if
(
!
file
)
Store
.
isRoot
=
RepoHelper
.
isRoot
(
Service
.
url
);
file
=
RepoHelper
.
setDirectoryOpen
(
file
);
file
=
RepoHelper
.
setDirectoryOpen
(
file
,
data
.
pageTitle
||
data
.
name
);
const
newDirectory
=
RepoHelper
.
dataToListOfFiles
(
data
);
Store
.
addFilesToDirectory
(
file
,
Store
.
files
,
newDirectory
);
Store
.
prevURL
=
Service
.
blobURLtoParentTree
(
Service
.
url
);
...
...
app/assets/javascripts/repo/stores/repo_store.js
View file @
e4412799
...
...
@@ -84,7 +84,7 @@ const RepoStore = {
}).
catch
(
Helper
.
loadingError
);
}
if
(
!
file
.
loading
)
Helper
.
updateHistoryEntry
(
file
.
url
,
file
.
name
);
if
(
!
file
.
loading
)
Helper
.
updateHistoryEntry
(
file
.
url
,
file
.
pageTitle
||
file
.
name
);
RepoStore
.
binary
=
file
.
binary
;
},
...
...
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