summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/repo/stores/actions.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/repo/stores/actions.js')
-rw-r--r--app/assets/javascripts/repo/stores/actions.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/assets/javascripts/repo/stores/actions.js b/app/assets/javascripts/repo/stores/actions.js
index 20aee8707b4..cccedf643f6 100644
--- a/app/assets/javascripts/repo/stores/actions.js
+++ b/app/assets/javascripts/repo/stores/actions.js
@@ -1,3 +1,4 @@
+import Vue from 'vue';
import flash from '../../flash';
import service from '../services';
import * as types from './mutation_types';
@@ -99,6 +100,15 @@ export const popHistoryState = ({ state, dispatch, getters }) => {
}
};
+export const scrollToTab = () => {
+ Vue.nextTick(() => {
+ const tabs = document.getElementById('tabs');
+ const tabEl = tabs.querySelector('.active');
+
+ tabs.scrollLeft = tabEl.offsetLeft;
+ });
+};
+
export * from './actions/tree';
export * from './actions/file';
export * from './actions/branch';