givanz/VvvebJs

Extend shorthand menu options to include List and Headings

Opened this issue · 1 comments

Hi @givanz
We need to extend the shorthand menu in Editor to include Headings(h1,h2,h3,etc) and Lists (Ordered/Unordered). Please find attached the snapshot exactly which place I am referring to :
image
Please suggest is there an option to configure the same in the editor settings?
Thank you for your support in advance.

Hi

You can add new buttons to text editor toolbar by adding the html to editor.html#L530-L535 and then add the event listener with the code to apply the style in libs/builder/builder.js#L683-L689

For headings you can use self.editorSetStyle("h1");

To insert new elements like lists at selection you can use iframeWindow.getSelection(); libs/builder/builder.js#L621