diff options
-rw-r--r-- | app/assets/javascripts/repo/components/repo_tabs.vue | 17 | ||||
-rw-r--r-- | app/assets/javascripts/repo/stores/repo_store.js | 1 | ||||
-rw-r--r-- | spec/javascripts/repo/components/repo_tabs_spec.js | 11 |
3 files changed, 3 insertions, 26 deletions
diff --git a/app/assets/javascripts/repo/components/repo_tabs.vue b/app/assets/javascripts/repo/components/repo_tabs.vue index 907a03e1601..bbd60d9d793 100644 --- a/app/assets/javascripts/repo/components/repo_tabs.vue +++ b/app/assets/javascripts/repo/components/repo_tabs.vue @@ -1,5 +1,4 @@ <script> -import Vue from 'vue'; import Store from '../stores/repo_store'; import RepoTab from './repo_tab.vue'; import RepoMixin from '../mixins/repo_mixin'; @@ -14,29 +13,19 @@ const RepoTabs = { data: () => Store, methods: { - isOverflow() { - return this.$el.scrollWidth > this.$el.offsetWidth; - }, - xClicked(file) { Store.removeFromOpenedFiles(file); }, }, - - watch: { - openedFiles() { - Vue.nextTick(() => { - this.tabsOverflow = this.isOverflow(); - }); - }, - }, }; export default RepoTabs; </script> <template> -<ul id="tabs" v-if="isMini" v-cloak :class="{'overflown': tabsOverflow}"> +<ul + v-if="isMini" + id="tabs"> <repo-tab v-for="tab in openedFiles" :key="tab.id" :tab="tab" :class="{'active' : tab.active}" @xclicked="xClicked"/> <li class="tabs-divider" /> </ul> diff --git a/app/assets/javascripts/repo/stores/repo_store.js b/app/assets/javascripts/repo/stores/repo_store.js index 06ca391ed0c..043aa965caa 100644 --- a/app/assets/javascripts/repo/stores/repo_store.js +++ b/app/assets/javascripts/repo/stores/repo_store.js @@ -27,7 +27,6 @@ const RepoStore = { tabSize: 100, defaultTabSize: 100, minTabSize: 30, - tabsOverflow: 41, submitCommitsLoading: false, binaryLoaded: false, dialog: { diff --git a/spec/javascripts/repo/components/repo_tabs_spec.js b/spec/javascripts/repo/components/repo_tabs_spec.js index fdb12cfc00f..60459e90c48 100644 --- a/spec/javascripts/repo/components/repo_tabs_spec.js +++ b/spec/javascripts/repo/components/repo_tabs_spec.js @@ -18,13 +18,11 @@ describe('RepoTabs', () => { it('renders a list of tabs', () => { RepoStore.openedFiles = openedFiles; - RepoStore.tabsOverflow = true; const vm = createComponent(); const tabs = [...vm.$el.querySelectorAll(':scope > li')]; expect(vm.$el.id).toEqual('tabs'); - expect(vm.$el.classList.contains('overflown')).toBeTruthy(); expect(tabs.length).toEqual(3); expect(tabs[0].classList.contains('active')).toBeTruthy(); expect(tabs[1].classList.contains('active')).toBeFalsy(); @@ -39,15 +37,6 @@ describe('RepoTabs', () => { expect(vm.$el.innerHTML).toBeFalsy(); }); - it('does not apply overflown class if not tabsOverflow', () => { - RepoStore.openedFiles = openedFiles; - RepoStore.tabsOverflow = false; - - const vm = createComponent(); - - expect(vm.$el.classList.contains('overflown')).toBeFalsy(); - }); - describe('methods', () => { describe('xClicked', () => { it('calls removeFromOpenedFiles with file obj', () => { |