Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I call the quill object API? #95

Open
theinvestigamer opened this issue Oct 10, 2022 · 1 comment
Open

How do I call the quill object API? #95

theinvestigamer opened this issue Oct 10, 2022 · 1 comment

Comments

@theinvestigamer
Copy link

Hi I have django-quill working perfectly, I'm just wondering how I can run quill methods from javascript? Is the quill object created for my field named something specific that I can use to call things like quill.getSelection() or quill.insertText()? I've tried quill, Quill, wrapper, wrapper.quill...

@theinvestigamer
Copy link
Author

theinvestigamer commented Oct 10, 2022

Update, I did a little test myself. Before quill media is imported I created a dictionary constant called "quills", then in the django-quill widget template I added wrapper to the dictionary with its ID as the key. This allows me to call API methods from "quills[quill_id].quill". If anyone has a more elegant method for making the object accessible, would love to see a PR for this feature.

Investigamer added a commit to Investigamer/django-quill-editor that referenced this issue Oct 10, 2022
Added a dictionary that tracks quill objects so the quill API can be called from outer scope
LeeHanYeong pushed a commit that referenced this issue Sep 20, 2024
Added a dictionary that tracks quill objects so the quill API can be called from outer scope
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant