1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-24 08:12:24 +02:00

Merge branch 'release-3.0' into dev

This commit is contained in:
Laurent Cozic 2024-06-27 11:54:19 +02:00
commit 78ecd28d73
5 changed files with 234 additions and 281 deletions

View File

@ -14,6 +14,7 @@ import createEditor from '@joplin/editor/CodeMirror/createEditor';
import CodeMirrorControl from '@joplin/editor/CodeMirror/CodeMirrorControl';
import WebViewToRNMessenger from '../../../utils/ipc/WebViewToRNMessenger';
import { WebViewToEditorApi } from '../types';
import { focus } from '@joplin/lib/utils/focusHandler';
export const initCodeMirror = (
parentElement: HTMLElement,
@ -47,6 +48,15 @@ export const initCodeMirror = (
}
});
// Note: Just adding an onclick listener seems sufficient to focus the editor when its background
// is tapped.
parentElement.addEventListener('click', (event) => {
const activeElement = document.querySelector(':focus');
if (!parentElement.contains(activeElement) && event.target === parentElement) {
focus('initial editor focus', control);
}
});
messenger.setLocalInterface(control);
return control;
};

View File

@ -101,10 +101,6 @@ function useHtml(initialCss: string): string {
scrolling. */
.cm-scroller {
overflow: none;
/* Ensure that the editor can be focused by clicking on the lower half of the screen.
Don't use 100vh to prevent a scrollbar being present for empty notes. */
min-height: 80vh;
}
</style>
<style class=${JSON.stringify(themeStyleSheetClassName)}>

View File

@ -310,6 +310,7 @@ class Setting extends BaseModel {
if (this.metadata_) return this.metadata_;
this.buildInMetadata_ = builtInMetadata(this);
this.metadata_ = { ...this.buildInMetadata_ };
this.metadata_ = { ...this.metadata_, ...this.customMetadata_ };

View File

@ -1534,6 +1534,8 @@ const builtInMetadata = (Setting: typeof SettingType) => {
appTypes: [AppType.Mobile],
description: () => _('Leave it blank to download the language files from the default website'),
label: () => _('Voice typing language files (URL)'),
// For now, iOS doesn't support voice typing.
show: () => shim.mobilePlatform() !== 'ios',
section: 'note',
},

File diff suppressed because it is too large Load Diff