1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-11 18:24:43 +02:00

Desktop: Configure RTE to handle the first table row as header (#10059)

This commit is contained in:
Marph 2024-03-05 17:52:43 +01:00 committed by GitHub
parent 3c10282848
commit be2f4d3d79
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -593,7 +593,7 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
'h1', 'h2', 'h3', '|',
'hr', '|',
'blockquote', '|',
'table', '|',
'tableWithHeader', '|',
`joplinInsertDateTime${toolbarPluginButtons}`,
];
@ -683,6 +683,22 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
},
});
editor.ui.registry.addMenuButton('tableWithHeader', {
icon: 'table',
tooltip: 'Table',
fetch: (callback) => {
callback([
{
type: 'fancymenuitem',
fancytype: 'inserttable',
onAction: (data) => {
editor.execCommand('mceInsertTable', false, { rows: data.numRows, columns: data.numColumns, options: { headerRows: 1 } });
},
},
]);
},
});
editor.ui.registry.addButton('joplinInsertDateTime', {
tooltip: _('Insert time'),
icon: 'insert-time',