JiHong88 / suneditor

Pure javascript based WYSIWYG html editor, with no dependencies.
http://suneditor.com
MIT License
1.77k stars 316 forks source link

Enable (activate) a button / plugin by default? #1425

Closed kaju74 closed 2 months ago

kaju74 commented 4 months ago

Hi,

is there a way to enable (activcate) a button by default? I want to "showBlocks" by default instead of clicking on the corresponding toolbar-button after the editor has been loaded.

Thank you for this great editor... ;-)

JiHong88 commented 3 months ago

editorInstance.core.commandHandler(editorInstance.core.allCommandButtons.showBlocks, 'showBlocks');

const editorInstance = suneditor.create(..)
editorInstance.onload = function (core, reload) {
  core.commandHandler(core.allCommandButtons.showBlocks, 'showBlocks');
}
kaju74 commented 2 months ago

Ops - missed your reply ;-) Thank you very much....