mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
ui: auto update editor height
This commit is contained in:
1 parent
58dca1d7bf
commit
2794a866c2
3 files changed
+6
-5
No files matched your search
@@ -37,7 +37,7 @@ export default class Editor extends DOMAttachedObject {
|
||||
async initMonaco() {
|
||||
const monaco = await import('monaco-editor/esm/vs/editor/editor.api');
|
||||
const { $dom } = this;
|
||||
const hasFocus = $dom.is(':focus');
|
||||
const hasFocus = $dom.is(':focus') || $dom.hasClass('autofocus');
|
||||
const origin = $dom.get(0);
|
||||
const ele = document.createElement('div');
|
||||
$(ele).width('100%');
|
||||
@@ -103,12 +103,13 @@ export default class Editor extends DOMAttachedObject {
|
||||
});
|
||||
this.isValid = true;
|
||||
if (hasFocus) this.focus();
|
||||
updateEditorHeight();
|
||||
}
|
||||
|
||||
async initVditor() {
|
||||
const { default: Vditor } = await import('vditor');
|
||||
const { $dom } = this;
|
||||
const hasFocus = $dom.is(':focus');
|
||||
const hasFocus = $dom.is(':focus') || $dom.hasClass('autofocus');
|
||||
const origin = $dom.get(0);
|
||||
const ele = document.createElement('div');
|
||||
const value = $dom.val();
|
||||
|
||||
Reference in new issue
Block a user