You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies as this is likely more of a question or suggestion rather than a bug report. I'm trying to add some additional functionality to a Trix editor that is imported and initialized in another module.
Using import Trix from "trix" again results in an initialization error as Trix is already initialized on the page. This makes it difficult to create a new Attachment programmatically as I can't call the constructor that is attached to the Trix module with new Trix.Attachment().
I can however get an instance of the editor from the page after load - is there a function accessible on the editor instance that I can use to create a new Attachment?
Specifically, I'm trying to create an insert a new Content Attachment but just using el.editor.insertAttachment({ content: html}) fails with an error t.getType is not a function - I assume the Attachment model has some additional required functions on its prototype?
Details
Trix version: ^1.0.0
Browser name and version: Chrome
Operating system: Windows
The text was updated successfully, but these errors were encountered:
Are you able to upgrade from ^1.0.0 to one of the ^2.0.0 releases? Depending on your build tool, the project's migration from CoffeeScript to ECMAScript Module support might have addressed the underlying cause responsible for the issue you're experiencing.
Apologies as this is likely more of a question or suggestion rather than a bug report. I'm trying to add some additional functionality to a Trix editor that is imported and initialized in another module.
Using
import Trix from "trix"
again results in an initialization error as Trix is already initialized on the page. This makes it difficult to create a new Attachment programmatically as I can't call the constructor that is attached to the Trix module withnew Trix.Attachment()
.I can however get an instance of the editor from the page after load - is there a function accessible on the editor instance that I can use to create a new Attachment?
Specifically, I'm trying to create an insert a new Content Attachment but just using
el.editor.insertAttachment({ content: html})
fails with an errort.getType is not a function
- I assume the Attachment model has some additional required functions on its prototype?Details
The text was updated successfully, but these errors were encountered: