vectorsize / substance-text

Substance Text
substance.github.com/text
MIT License
282 stars 26 forks source link

Multiple simultaneous editors on page #9

Closed ericmjonas closed 12 years ago

ericmjonas commented 12 years ago

I'd love to have multiple simultaneous editors on the page, but when I try and instantiate Proper multiple times, there's only a single toolbar created. Are there any known work-arounds?

michael commented 12 years ago

After careful thinking we decided that it's overkill to have more than one instance simultaneously. Just reinit the Proper instance when you click on another content-area. You can specify where the controls should be injected using the controlsTarget option.

ericmjonas commented 12 years ago

I've pasted the code I'm using here: https://gist.github.com/1230652

What seems to happen is the most recently-activated instance gets the toolbar, and per the deactivate() method in the source, the other one goes away. Can I confirm this is intended behavior? Or am I doing something wrong. And thank you so much for making such a great editor!

afeld commented 12 years ago

The Proper constructor function can (should?) be rewritten so the functions only need to be defined once on the prototype - will cut down on the overhead of instantiating an editor.