diff options
author | Phil Hughes <me@iamphill.com> | 2017-12-15 10:21:49 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-12-15 16:33:36 +0000 |
commit | eaf2f48dc7db706fa1dea050543667f8cdebd4c4 (patch) | |
tree | 0333f4371bd9158bba99bb68c2c4a6aa960daa5e /app/assets/javascripts/init_notes.js | |
parent | d2f313dcbccc1e3642fb0ccdf0849e0ef4ec8e21 (diff) | |
download | gitlab-ce-eaf2f48dc7db706fa1dea050543667f8cdebd4c4.tar.gz |
Export and use Notes ES module
Diffstat (limited to 'app/assets/javascripts/init_notes.js')
-rw-r--r-- | app/assets/javascripts/init_notes.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/assets/javascripts/init_notes.js b/app/assets/javascripts/init_notes.js index 3a8b4360cb6..882aedfcc76 100644 --- a/app/assets/javascripts/init_notes.js +++ b/app/assets/javascripts/init_notes.js @@ -1,4 +1,4 @@ -/* global Notes */ +import Notes from './notes'; export default () => { const dataEl = document.querySelector('.js-notes-data'); @@ -10,5 +10,7 @@ export default () => { autocomplete, } = JSON.parse(dataEl.innerHTML); - window.notes = new Notes(notesUrl, notesIds, now, diffView, autocomplete); + // Create a singleton so that we don't need to assign + // into the window object, we can just access the current isntance with Notes.instance + Notes.initialize(notesUrl, notesIds, now, diffView, autocomplete); }; |