BigW Consortium Gitlab

get branch name from the DOM

parent ac8e94d4
......@@ -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),
});
......
#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),
......
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