Menus
These options control the menubar at the top of the editor and the context menu that appears on right-click.
Options
| Option | Type | Default | Description |
|---|---|---|---|
menubar | boolean/string | true (phones: false) | Enable or configure the menubar. true shows the default menus, false hides it, or pass a space-separated string of menu names to show specific menus. |
menu | object | {} | Custom menu structure. Each key is a menu name and the value is an object with title and items properties. |
removed_menuitems | string | '' | Space-separated list of menu item names to remove from all menus. |
contextmenu | string/string[]/false | 'link linkchecker image editimage table spellchecker configurepermanentpen' | Context menu sections shown on right-click. Pass false to use the browser's native context menu. |
contextmenu_avoid_overlap | string | '' | CSS selector for elements that the context menu should not overlap. The menu repositions itself to avoid covering matched elements. |
contextmenu_never_use_native | boolean | false | Always show the Editor42 context menu, even when the editor would normally fall back to the browser's native menu. |
Example
editor42.init({
selector: 'textarea',
menubar: 'file edit view insert format table',
menu: {
custom: {
title: 'My Menu',
items: 'bold italic | removeformat'
}
},
removed_menuitems: 'newdocument print',
contextmenu: 'link image table'
});