diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-03-01 02:21:08 -0600 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2018-03-01 11:29:26 -0600 |
commit | ce4dd19e09612dc9347b055190f86d805cdc8ef3 (patch) | |
tree | 983214b9f9cc3204736e0ff484d05956b98e4a7e /app/assets/javascripts/blob | |
parent | 9d9d0105947e4cc23f150135e0c904d6ad31f315 (diff) | |
download | gitlab-ce-ce4dd19e09612dc9347b055190f86d805cdc8ef3.tar.gz |
migrate stl_viewer to dynamic import
Diffstat (limited to 'app/assets/javascripts/blob')
-rw-r--r-- | app/assets/javascripts/blob/stl_viewer.js | 4 | ||||
-rw-r--r-- | app/assets/javascripts/blob/viewer/index.js | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/app/assets/javascripts/blob/stl_viewer.js b/app/assets/javascripts/blob/stl_viewer.js index f611c4fe640..63236b6477f 100644 --- a/app/assets/javascripts/blob/stl_viewer.js +++ b/app/assets/javascripts/blob/stl_viewer.js @@ -1,6 +1,6 @@ import Renderer from './3d_viewer'; -document.addEventListener('DOMContentLoaded', () => { +export default () => { const viewer = new Renderer(document.getElementById('js-stl-viewer')); [].slice.call(document.querySelectorAll('.js-material-changer')).forEach((el) => { @@ -16,4 +16,4 @@ document.addEventListener('DOMContentLoaded', () => { viewer.changeObjectMaterials(target.dataset.type); }); }); -}); +}; diff --git a/app/assets/javascripts/blob/viewer/index.js b/app/assets/javascripts/blob/viewer/index.js index ac18e6fb9f9..92ea91c45a8 100644 --- a/app/assets/javascripts/blob/viewer/index.js +++ b/app/assets/javascripts/blob/viewer/index.js @@ -41,6 +41,9 @@ export default class BlobViewer { case 'sketch': initViewer(import(/* webpackChunkName: 'sketch_viewer' */ '../sketch_viewer')); break; + case 'stl': + initViewer(import(/* webpackChunkName: 'stl_viewer' */ '../stl_viewer')); + break; default: break; } |