get branch name from the DOM
This commit is contained in:
parent
ac8e94d4d5
commit
307883a5eb
|
@ -9,6 +9,8 @@ import store from './stores';
|
|||
import Translate from '../vue_shared/translate';
|
||||
|
||||
function initRepo(el) {
|
||||
if (!el) return null;
|
||||
|
||||
return new Vue({
|
||||
el,
|
||||
store,
|
||||
|
@ -38,8 +40,7 @@ function initRepo(el) {
|
|||
onTopOfBranch: convertPermissionToBoolean(data.onTopOfBranch),
|
||||
currentRef: data.ref,
|
||||
path: data.currentPath,
|
||||
// TODO: get through data attribute
|
||||
currentBranch: document.querySelector('.js-project-refs-dropdown').dataset.ref,
|
||||
currentBranch: data.currentBranch,
|
||||
isRoot: convertPermissionToBoolean(data.root),
|
||||
isInitialRoot: convertPermissionToBoolean(data.root),
|
||||
});
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#repo{ data: { root: @path.empty?.to_s,
|
||||
root_url: project_tree_path(project),
|
||||
url: content_url,
|
||||
current_branch: @ref,
|
||||
ref: @commit.id,
|
||||
project_name: project.name,
|
||||
project_url: project_path(project),
|
||||
|
|
Loading…
Reference in New Issue