diff --git a/app/javascript/src/boot.coffee b/app/javascript/src/boot.coffee index ebd36395..4b1233a3 100644 --- a/app/javascript/src/boot.coffee +++ b/app/javascript/src/boot.coffee @@ -51,7 +51,7 @@ window.TagCompletion = new TagCompletion window.TagScript = new TagScript window.UrlHash = new UrlHashHandler window.User = new User -window.autocomplete = new Autocomplete +window.autocomplete = new Autocomplete(window.TagCompletion) window.checkAll = new CheckAll window.comment = new Comment window.dmail = new Dmail diff --git a/app/javascript/src/classes/autocomplete.coffee b/app/javascript/src/classes/autocomplete.coffee index d95050e9..11d59ab4 100644 --- a/app/javascript/src/classes/autocomplete.coffee +++ b/app/javascript/src/classes/autocomplete.coffee @@ -1,4 +1,6 @@ import autocompleter from 'autocompleter' +import TagCompletion from './tag_completion' +import TagCompletionBox from './tag_completion_box' $ = jQuery @@ -7,7 +9,7 @@ autocompleterMap = (match) => value: match export default class Autocomplete - constructor: -> + constructor: (@tagCompletionInstance) -> $ => @_genericCompletionAll() @_tagCompletion() @@ -43,4 +45,4 @@ export default class Autocomplete return if !tags? new TagCompletionBox(tags) - TagCompletion?.observe_tag_changes_on_submit editForm, tags + @tagCompletionInstance.observe_tag_changes_on_submit editForm, tags