Commit ef05b87f authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'jnnkl-remove-eventlistener-blob-show' into 'master'

Remove obsolete DOMContentLoadedEventListener

See merge request gitlab-org/gitlab!55615
parents c566f186 a23e85a8
...@@ -7,13 +7,12 @@ import initWebIdeLink from '~/pages/projects/shared/web_ide_link'; ...@@ -7,13 +7,12 @@ import initWebIdeLink from '~/pages/projects/shared/web_ide_link';
import commitPipelineStatus from '~/projects/tree/components/commit_pipeline_status_component.vue'; import commitPipelineStatus from '~/projects/tree/components/commit_pipeline_status_component.vue';
import '~/sourcegraph/load'; import '~/sourcegraph/load';
document.addEventListener('DOMContentLoaded', () => { new BlobViewer(); // eslint-disable-line no-new
new BlobViewer(); // eslint-disable-line no-new initBlob();
initBlob();
const CommitPipelineStatusEl = document.querySelector('.js-commit-pipeline-status'); const CommitPipelineStatusEl = document.querySelector('.js-commit-pipeline-status');
const statusLink = document.querySelector('.commit-actions .ci-status-link'); const statusLink = document.querySelector('.commit-actions .ci-status-link');
if (statusLink) { if (statusLink) {
statusLink.remove(); statusLink.remove();
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new Vue({ new Vue({
...@@ -29,15 +28,15 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -29,15 +28,15 @@ document.addEventListener('DOMContentLoaded', () => {
}); });
}, },
}); });
} }
initWebIdeLink({ el: document.getElementById('js-blob-web-ide-link') }); initWebIdeLink({ el: document.getElementById('js-blob-web-ide-link') });
GpgBadges.fetch(); GpgBadges.fetch();
const codeNavEl = document.getElementById('js-code-navigation'); const codeNavEl = document.getElementById('js-code-navigation');
if (codeNavEl) { if (codeNavEl) {
const { codeNavigationPath, blobPath, definitionPathPrefix } = codeNavEl.dataset; const { codeNavigationPath, blobPath, definitionPathPrefix } = codeNavEl.dataset;
// eslint-disable-next-line promise/catch-or-return // eslint-disable-next-line promise/catch-or-return
...@@ -47,11 +46,11 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -47,11 +46,11 @@ document.addEventListener('DOMContentLoaded', () => {
definitionPathPrefix, definitionPathPrefix,
}), }),
); );
} }
const successPipelineEl = document.querySelector('.js-success-pipeline-modal'); const successPipelineEl = document.querySelector('.js-success-pipeline-modal');
if (successPipelineEl) { if (successPipelineEl) {
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new Vue({ new Vue({
el: successPipelineEl, el: successPipelineEl,
...@@ -63,5 +62,4 @@ document.addEventListener('DOMContentLoaded', () => { ...@@ -63,5 +62,4 @@ document.addEventListener('DOMContentLoaded', () => {
}); });
}, },
}); });
} }
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment