diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2018-03-18 18:28:04 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2018-03-19 20:38:54 +0300 |
commit | db6948aa8daf99576b545e1cbfdebe023630ea14 (patch) | |
tree | cf615018388a5eb2c18c540e5fcb823fede26bf1 /app/assets | |
parent | ae3553dbf4afd981ef6682d7deb104c7038a5a60 (diff) |
Merge branch 'fix-dropzone-project-show' into 'master'
Fix dropzone project show
Closes #44137
See merge request gitlab-org/gitlab-ce!17784
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/pages/projects/show/index.js | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/app/assets/javascripts/pages/projects/show/index.js b/app/assets/javascripts/pages/projects/show/index.js index 9b87f249f09..3b0f0f960b8 100644 --- a/app/assets/javascripts/pages/projects/show/index.js +++ b/app/assets/javascripts/pages/projects/show/index.js @@ -1,3 +1,5 @@ +import $ from 'jquery'; +import initBlob from '~/blob_edit/blob_bundle'; import ShortcutsNavigation from '~/shortcuts_navigation'; import NotificationsForm from '~/notifications_form'; import UserCallout from '~/user_callout'; @@ -18,10 +20,22 @@ document.addEventListener('DOMContentLoaded', () => { className: 'js-autodevops-banner', }); - if ($('#tree-slider').length) new TreeView(); // eslint-disable-line no-new - if ($('.blob-viewer').length) new BlobViewer(); // eslint-disable-line no-new - if ($('.project-show-activity').length) new Activities(); // eslint-disable-line no-new - $('#tree-slider').waitForImages(() => { + // Project show page loads different overview content based on user preferences + const treeSlider = document.querySelector('#tree-slider'); + if (treeSlider) { + new TreeView(); // eslint-disable-line no-new + initBlob(); + } + + if (document.querySelector('.blob-viewer')) { + new BlobViewer(); // eslint-disable-line no-new + } + + if (document.querySelector('.project-show-activity')) { + new Activities(); // eslint-disable-line no-new + } + + $(treeSlider).waitForImages(() => { ajaxGet(document.querySelector('.js-tree-content').dataset.logsPath); }); }); |