diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-22 18:09:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-22 18:09:48 +0300 |
commit | 640007842a876dfa551578feccfd0fe2307c522a (patch) | |
tree | 4204c45a13b9beac3040df00572ffe0ecdb0ca40 /app/assets/javascripts/milestones/milestone.js | |
parent | 421f6c92d5984d035a7a6687d70277ba88f5f92b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/milestones/milestone.js')
-rw-r--r-- | app/assets/javascripts/milestones/milestone.js | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/app/assets/javascripts/milestones/milestone.js b/app/assets/javascripts/milestones/milestone.js index 05102f73f92..8f2721c2a5b 100644 --- a/app/assets/javascripts/milestones/milestone.js +++ b/app/assets/javascripts/milestones/milestone.js @@ -1,33 +1,27 @@ import createFlash from '~/flash'; import { sanitize } from '~/lib/dompurify'; import axios from '~/lib/utils/axios_utils'; -import { historyPushState } from '~/lib/utils/common_utils'; import { __ } from '~/locale'; -import { GlTabsBehavior, TAB_SHOWN_EVENT } from '~/tabs'; +import { GlTabsBehavior, TAB_SHOWN_EVENT, HISTORY_TYPE_HASH } from '~/tabs'; export default class Milestone { constructor() { this.tabsEl = document.querySelector('.js-milestone-tabs'); - this.glTabs = new GlTabsBehavior(this.tabsEl); this.loadedTabs = new WeakSet(); this.bindTabsSwitching(); - this.loadInitialTab(); + // eslint-disable-next-line no-new + new GlTabsBehavior(this.tabsEl, { history: HISTORY_TYPE_HASH }); } bindTabsSwitching() { this.tabsEl.addEventListener(TAB_SHOWN_EVENT, (event) => { const tab = event.target; const { activeTabPanel } = event.detail; - historyPushState(tab.getAttribute('href')); this.loadTab(tab, activeTabPanel); }); } - loadInitialTab() { - const tab = this.tabsEl.querySelector(`a[href="${window.location.hash}"]`); - this.glTabs.activateTab(tab || this.glTabs.activeTab); - } loadTab(tab, tabPanel) { const { endpoint } = tab.dataset; |