Expand Quill Toolbar for Multiple Editors

With a great quill rich text editor for javascript. I am trying to make two or more editors with the same toolbar.

I believe (from the documentation ) that this is not possible right away, so I'm trying to "simulate" this adding a toolbar module through an API to an editor that was clicked as the last one:

// this uses jQuery $editorTag.click(function(e){ var tag = e.target; var editor = getEditorByTag(tag); if( editor ) editor.addModule('toolbar',{container:'#toolbar'}); }); 

This seems to work, but I suspect that Quill does not like to add the same module over and over again on the same object over and over again, because in the end it spits:

(node) warning: EventEmitter memory leak detection possible. 11 listeners added. Use emitter.setMaxListeners () to increase the limit. quill.js (line 4727)

So, is there a way to remove a previously added module? Sort of:

 // installs editor var editor = new Quill('#editor'); // adds toolbar module editor.addModule('toolbar',{container:'#toolbar'}); // removes just added toolbar module editor.removeModule('toolbar'); 
+5
source share

Source: https://habr.com/ru/post/1234876/


All Articles