What are all the possible settings attributes in TinyMCE's addButton() function?

前端 未结 3 526
误落风尘
误落风尘 2021-01-30 20:33

The documentation is not very clear on this.

name - String - Button name to add.

settings - Object - Settings object with title, cmd etc

相关标签:
3条回答
  • 2021-01-30 20:44

    What you would like to know is what settings may fit into the settings object (tinymce 3). Here it is:

    title       --> title
    label       --> label
    scope       --> scope
    onclick     --> function to be called onclick
    menu_button --> flag, defines if the button is a menu button
    cmd         --> tinymce command to get executed onClick
    ui          --> paramter for the tinymce command cmd
    value       --> value for the tinymce command cmd
    

    Those settings get assigned in the function createButton of the class ControlManager.

    0 讨论(0)
  • 2021-01-30 20:45
    • autofocus: True if the control should be focused when rendered
    • border: Border box values example: 1 1 1 1
    • classes: Space separated list of classes to add
    • disabled: Is the control disabled by default
    • hidden: Is the control hidden by default
    • icon: Icon to use for button
    • image: Image to use for icon
    • margin: Margin box values example: 1 1 1 1
    • minHeight: Minimal height for the control
    • minWidth: Minimal width for the control
    • name: Name of the control instance
    • padding: Padding box values example: 1 1 1 1
    • role: WAI-ARIA role to use for control
    • size: Size of the button small|medium|large
    • style: Style CSS properties to add
    • text: Text to display inside widget
    • tooltip: Tooltip text to display when hovering

    For a full list of all the settings and methods see the TinyMCE documentation page

    0 讨论(0)
  • 2021-01-30 20:48

    Having had the same issue trying to find the addButton docs in V4 I found the link, just in case anybody needs it.

    tinymce.ui.Button

    Hope it helps someone!

    0 讨论(0)
提交回复
热议问题