mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-22 16:26:09 +01:00
This commit is contained in:
parent
23899f762c
commit
9a7ac9e7d8
1 changed files with 4 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import {
|
||||
focusBlock,
|
||||
focusBlock, focusByOffset,
|
||||
focusByRange, focusByWbr,
|
||||
getEditorRange,
|
||||
getEditorRange, getSelectionOffset,
|
||||
} from "../util/selection";
|
||||
import {fetchPost} from "../../util/fetch";
|
||||
import {replaceFileName, validateName} from "../../editor/rename";
|
||||
|
|
@ -252,7 +252,9 @@ export class Title {
|
|||
private rename(protyle: IProtyle) {
|
||||
clearTimeout(this.timeout);
|
||||
if (!validateName(this.editElement.textContent)) {
|
||||
const offset = getSelectionOffset(this.editElement)
|
||||
this.setTitle(this.editElement.textContent.substring(0, Constants.SIZE_TITLE));
|
||||
focusByOffset(this.editElement, offset.start, offset.end);
|
||||
return false;
|
||||
}
|
||||
this.timeout = window.setTimeout(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue