mirror of
https://github.com/zadam/trilium.git
synced 2025-11-08 22:35:50 +01:00
feat(math): support multi-line formula editing
This commit is contained in:
@@ -110,6 +110,26 @@ export default class MathUI extends Plugin {
|
||||
cancel();
|
||||
} );
|
||||
|
||||
// Allow pressing Enter to submit changes, and use Shift+Enter to insert a new line
|
||||
formView.keystrokes.set('enter', (data, cancel) => {
|
||||
if (!data.shiftKey) {
|
||||
formView.fire('submit');
|
||||
cancel();
|
||||
}
|
||||
});
|
||||
|
||||
// Allow the textarea to be resizable
|
||||
formView.mathInputView.fieldView.once('render', () => {
|
||||
const textarea = formView.mathInputView.fieldView.element;
|
||||
if (!textarea) return;
|
||||
textarea.focus();
|
||||
Object.assign(textarea.style, {
|
||||
resize: 'both',
|
||||
height: '100px',
|
||||
minWidth: '100%',
|
||||
});
|
||||
});
|
||||
|
||||
return formView;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user