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
307883a5
Commit
307883a5
authored
Oct 31, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get branch name from the DOM
parent
ac8e94d4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
app/assets/javascripts/repo/index.js
app/assets/javascripts/repo/index.js
+3
-2
app/views/shared/repo/_repo.html.haml
app/views/shared/repo/_repo.html.haml
+1
-0
No files found.
app/assets/javascripts/repo/index.js
View file @
307883a5
...
@@ -9,6 +9,8 @@ import store from './stores';
...
@@ -9,6 +9,8 @@ import store from './stores';
import
Translate
from
'
../vue_shared/translate
'
;
import
Translate
from
'
../vue_shared/translate
'
;
function
initRepo
(
el
)
{
function
initRepo
(
el
)
{
if
(
!
el
)
return
null
;
return
new
Vue
({
return
new
Vue
({
el
,
el
,
store
,
store
,
...
@@ -38,8 +40,7 @@ function initRepo(el) {
...
@@ -38,8 +40,7 @@ function initRepo(el) {
onTopOfBranch
:
convertPermissionToBoolean
(
data
.
onTopOfBranch
),
onTopOfBranch
:
convertPermissionToBoolean
(
data
.
onTopOfBranch
),
currentRef
:
data
.
ref
,
currentRef
:
data
.
ref
,
path
:
data
.
currentPath
,
path
:
data
.
currentPath
,
// TODO: get through data attribute
currentBranch
:
data
.
currentBranch
,
currentBranch
:
document
.
querySelector
(
'
.js-project-refs-dropdown
'
).
dataset
.
ref
,
isRoot
:
convertPermissionToBoolean
(
data
.
root
),
isRoot
:
convertPermissionToBoolean
(
data
.
root
),
isInitialRoot
:
convertPermissionToBoolean
(
data
.
root
),
isInitialRoot
:
convertPermissionToBoolean
(
data
.
root
),
});
});
...
...
app/views/shared/repo/_repo.html.haml
View file @
307883a5
#repo
{
data:
{
root:
@path
.
empty?
.
to_s
,
#repo
{
data:
{
root:
@path
.
empty?
.
to_s
,
root_url:
project_tree_path
(
project
),
root_url:
project_tree_path
(
project
),
url:
content_url
,
url:
content_url
,
current_branch:
@ref
,
ref:
@commit
.
id
,
ref:
@commit
.
id
,
project_name:
project
.
name
,
project_name:
project
.
name
,
project_url:
project_path
(
project
),
project_url:
project_path
(
project
),
...
...
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