mizzao / meteor-sharejs

Meteor smart package for transparently adding ShareJS editors to an app
MIT License
225 stars 53 forks source link

Multiple Ace Editor IDs #77

Closed felixs8696 closed 7 years ago

felixs8696 commented 8 years ago

Our project requires multiple ace editors, but the template that is built in this package requires an id of "editor", so we can only get the first instance of the editor using var editor = ace.edit('editor'). Is it possible to change this id or have a workaround for this problem?

edemaine commented 8 years ago

I use the onRender=config callback to store the editor with the template instance, like this (in CoffeeScript):

Template.submessage.helpers
  config: ->
    ti = Tracker.nonreactive -> Template.instance()
    (editor) =>
      ti.editor = editor
      ...
DavidSichau commented 7 years ago

Close as there was no followup. And a solution is provided.