diff options
author | Clement Ho <clemmakesapps@gmail.com> | 2018-03-18 18:28:04 +0300 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2018-03-18 18:28:04 +0300 |
commit | 78a8a79b01df2c766b9a76a525b940483a0f7106 (patch) | |
tree | b5b090da16460263315276afbf37c96cf0d907e9 /app/assets/javascripts/pages/projects/show/index.js | |
parent | ea5221aeb358ef6c349cfa09b9c6993bd7bd027d (diff) |
Fix dropzone project show
Diffstat (limited to 'app/assets/javascripts/pages/projects/show/index.js')
-rw-r--r-- | app/assets/javascripts/pages/projects/show/index.js | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/app/assets/javascripts/pages/projects/show/index.js b/app/assets/javascripts/pages/projects/show/index.js index a6a172402d8..3b0f0f960b8 100644 --- a/app/assets/javascripts/pages/projects/show/index.js +++ b/app/assets/javascripts/pages/projects/show/index.js @@ -1,4 +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'; @@ -19,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); }); }); |