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

Add insert config #30

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

afandiyusuf
Copy link
Contributor

@afandiyusuf afandiyusuf commented Dec 1, 2020

@xrb21 Hello, Great plugin :).

In this pull request, I added insertConfig parameter to HtmlEditor(), so we can disable/enable the insert toolbar.
For the value of that parameter, we can check the official documentation from summernote since I just parsing the list string and inject it into the initialization summer note javascript.

example:
we can use ['link','picture','vide','table']

I make the bottom toolbar hide/show too depends on how these parameters are set.
example:
if we use insertConfig: ['link'] the image bottom toolbar would be hidden since we didn't use 'image' for insertConfig.

NB: I change id "summernote" to "summernote-2" for preventing auto initialization, so we can make our own initialization with custom config.

This is how to use HtmlEditor after we merge this pull request

HtmlEditor(
      hint: "Your text here...",
      //value: "text content initial, if any",
      key: keyEditor,
      height: 400,
      insertConfig: ['link','video'],
)

Related Issue #4 #8
Thanks.

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

Successfully merging this pull request may close these issues.

1 participant