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 attributes from toolbar options #1084

Closed
lughino opened this issue Oct 27, 2016 · 4 comments
Closed

Add attributes from toolbar options #1084

lughino opened this issue Oct 27, 2016 · 4 comments
Labels

Comments

@lughino
Copy link

lughino commented Oct 27, 2016

Starting from a simple addition of features like to add tooltips to the buttons, I looked into your file and found an example where just add your toolbar by creating an html markup.
While this is very good, it is often more useful to generate the toolbar through the options.
It would be very useful to be able to pass the attributes to the options so that these are attached to the elements.
For example like this:

const toolbarOptions = [
    [
      { 'bold': {  
          attributes: { 
            'data-toggle': 'tooltip', 
            'data-placement': 'bottom', 
            'title': 'Bold' 
          }
        } 
      }, 'italic', 'underline', 'strike'],
   // other options..
  ];

I think this adds a simple but powerful additional customization without touching the html.

@jhchen jhchen changed the title [FEATURE REQUEST] add attributes from toolbar options Add attributes from toolbar options Oct 31, 2016
@jhchen jhchen added the feature label Oct 31, 2016
@rickghome
Copy link

Really simple feature, and enhances the UI with a standard means of helping users.

@Abrahamlet
Copy link

Would be a great enhancement to a great product.

@jhchen
Copy link
Member

jhchen commented Mar 29, 2017

I don't want Quill's toolbar to be an endlessly configurable HTML generator. You can always pass in custom HTML toolbar container for advanced use cases and Quill will attach to those inputs. For quick simple use cases Quill recognizes a simple list of formats.

Is can be debated forever where the "quick simple" line should be and how far it can be extended but the core Quill project has drawn that line where it feels is the right balance between simplicity and power.

Those that disagree please feel free to extend the Toolbar module and publish separately to npm if you would like to share with others. The naming convention is quill-yourname-module. For example quill-image-drop-module is a recent community contributed module that extends Quill for use cases the core does not cover. We are in the process of creating a curated list of high quality community contributed modules.

@lhd-1727865856
Copy link

怎么添加控制文本行间距

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants