Commit 307883a5 authored by Phil Hughes's avatar Phil Hughes

get branch name from the DOM

parent ac8e94d4
...@@ -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),
}); });
......
#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),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment