summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/repo/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/repo/index.js')
-rw-r--r--app/assets/javascripts/repo/index.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/repo/index.js b/app/assets/javascripts/repo/index.js
index 480d46eab81..b6801af7fcb 100644
--- a/app/assets/javascripts/repo/index.js
+++ b/app/assets/javascripts/repo/index.js
@@ -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),
});