Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/tabs/tabs.js')
-rw-r--r--app/assets/javascripts/vue_shared/components/tabs/tabs.js76
1 files changed, 0 insertions, 76 deletions
diff --git a/app/assets/javascripts/vue_shared/components/tabs/tabs.js b/app/assets/javascripts/vue_shared/components/tabs/tabs.js
deleted file mode 100644
index 233df96a520..00000000000
--- a/app/assets/javascripts/vue_shared/components/tabs/tabs.js
+++ /dev/null
@@ -1,76 +0,0 @@
-export default {
- props: {
- stopPropagation: {
- type: Boolean,
- required: false,
- default: false,
- },
- },
- data() {
- return {
- currentIndex: 0,
- tabs: [],
- };
- },
- mounted() {
- this.updateTabs();
- },
- methods: {
- updateTabs() {
- this.tabs = this.$children.filter((child) => child.isTab);
- this.currentIndex = this.tabs.findIndex((tab) => tab.localActive);
- },
- setTab(e, index) {
- if (this.stopPropagation) {
- e.stopPropagation();
- e.preventDefault();
- }
-
- this.tabs[this.currentIndex].localActive = false;
- this.tabs[index].localActive = true;
-
- this.currentIndex = index;
- },
- },
- render(h) {
- const navItems = this.tabs.map((tab, i) =>
- h(
- 'li',
- {
- key: i,
- },
- [
- h(
- 'a',
- {
- class: tab.localActive ? 'active' : null,
- attrs: {
- href: '#',
- },
- on: {
- click: (e) => this.setTab(e, i),
- },
- },
- tab.$slots.title || tab.title,
- ),
- ],
- ),
- );
- const nav = h(
- 'ul',
- {
- class: 'nav-links tab-links',
- },
- [navItems],
- );
- const content = h(
- 'div',
- {
- class: ['tab-content'],
- },
- [this.$slots.default],
- );
-
- return h('div', {}, [[nav], content]);
- },
-};