mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-04 11:50:15 +01:00
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
dc1ea4894b
commit
e92cc285a6
1 changed files with 3 additions and 2 deletions
|
|
@ -4,7 +4,7 @@ import {isMobile} from "./functions";
|
|||
import {fetchPost} from "./fetch";
|
||||
import {Dialog} from "../dialog";
|
||||
import {getOpenNotebookCount} from "./pathName";
|
||||
import {validateName} from "../editor/rename";
|
||||
import {replaceFileName, validateName} from "../editor/rename";
|
||||
import {setStorageVal} from "../protyle/util/compatibility";
|
||||
import {openFileById} from "../editor/util";
|
||||
import {openMobileFileById} from "../mobile/editor";
|
||||
|
|
@ -123,10 +123,11 @@ export const newNotebook = () => {
|
|||
dialog.destroy();
|
||||
});
|
||||
btnsElement[1].addEventListener("click", () => {
|
||||
const name = dialog.element.querySelector("input").value;
|
||||
let name = dialog.element.querySelector("input").value;
|
||||
if (!validateName(name)) {
|
||||
return false;
|
||||
}
|
||||
name = replaceFileName(name);
|
||||
fetchPost("/api/notebook/createNotebook", {
|
||||
name
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue