mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
This commit is contained in:
parent
abdf78768b
commit
f51a81cc3f
5 changed files with 5 additions and 9 deletions
|
|
@ -5,7 +5,6 @@ import {genOptions} from "../../util/genOptions";
|
||||||
import {reloadProtyle} from "../../protyle/util/reload";
|
import {reloadProtyle} from "../../protyle/util/reload";
|
||||||
|
|
||||||
export const initAppearance = (modelElement: HTMLElement, modelMainElement: HTMLElement) => {
|
export const initAppearance = (modelElement: HTMLElement, modelMainElement: HTMLElement) => {
|
||||||
closePanel();
|
|
||||||
modelElement.style.top = "0";
|
modelElement.style.top = "0";
|
||||||
modelElement.querySelector(".toolbar__icon").innerHTML = '<use xlink:href="#iconTheme"></use>';
|
modelElement.querySelector(".toolbar__icon").innerHTML = '<use xlink:href="#iconTheme"></use>';
|
||||||
modelElement.querySelector(".toolbar__text").textContent = window.siyuan.languages.appearance;
|
modelElement.querySelector(".toolbar__text").textContent = window.siyuan.languages.appearance;
|
||||||
|
|
|
||||||
|
|
@ -124,8 +124,10 @@ export const goBack = () => {
|
||||||
!window.siyuan.menus.menu.element.classList.contains("fn__none")) {
|
!window.siyuan.menus.menu.element.classList.contains("fn__none")) {
|
||||||
window.siyuan.menus.menu.element.dispatchEvent(new CustomEvent("click", {detail: "back"}));
|
window.siyuan.menus.menu.element.dispatchEvent(new CustomEvent("click", {detail: "back"}));
|
||||||
return;
|
return;
|
||||||
} else if (document.getElementById("model").style.top === "0px" ||
|
} else if (document.getElementById("model").style.top === "0px") {
|
||||||
document.getElementById("menu").style.right === "0px" ||
|
document.getElementById("model").style.top = "-200vh";
|
||||||
|
return;
|
||||||
|
} else if (document.getElementById("menu").style.right === "0px" ||
|
||||||
document.getElementById("sidebar").style.left === "0px") {
|
document.getElementById("sidebar").style.left === "0px") {
|
||||||
closePanel();
|
closePanel();
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ export const initFramework = () => {
|
||||||
}, Constants.TIMEOUT_INPUT);
|
}, Constants.TIMEOUT_INPUT);
|
||||||
}
|
}
|
||||||
document.getElementById("modelClose").addEventListener("click", () => {
|
document.getElementById("modelClose").addEventListener("click", () => {
|
||||||
closePanel();
|
document.getElementById("model").style.top = "-200vh";
|
||||||
});
|
});
|
||||||
initEditorName();
|
initEditorName();
|
||||||
if (getOpenNotebookCount() > 0) {
|
if (getOpenNotebookCount() > 0) {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@ import {pathPosix} from "../../util/pathName";
|
||||||
import {activeBlur, hideKeyboardToolbar} from "./keyboardToolbar";
|
import {activeBlur, hideKeyboardToolbar} from "./keyboardToolbar";
|
||||||
|
|
||||||
const showAccountInfo = (modelElement: HTMLElement, modelMainElement: Element) => {
|
const showAccountInfo = (modelElement: HTMLElement, modelMainElement: Element) => {
|
||||||
closePanel();
|
|
||||||
let userTitlesHTML = "";
|
let userTitlesHTML = "";
|
||||||
if (window.siyuan.user.userTitles.length > 0) {
|
if (window.siyuan.user.userTitles.length > 0) {
|
||||||
userTitlesHTML = '<div class="fn__hr--b"></div><div class="fn__flex" style="position: absolute"><span class="fn__space"></span>';
|
userTitlesHTML = '<div class="fn__hr--b"></div><div class="fn__flex" style="position: absolute"><span class="fn__space"></span>';
|
||||||
|
|
@ -244,7 +243,6 @@ ${accountHTML}
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
break;
|
break;
|
||||||
} else if (target.id === "menuSync") {
|
} else if (target.id === "menuSync") {
|
||||||
closePanel();
|
|
||||||
modelElement.style.top = "0";
|
modelElement.style.top = "0";
|
||||||
modelElement.querySelector(".toolbar__icon").innerHTML = '<use xlink:href="#iconCloud"></use>';
|
modelElement.querySelector(".toolbar__icon").innerHTML = '<use xlink:href="#iconCloud"></use>';
|
||||||
modelElement.querySelector(".toolbar__text").textContent = window.siyuan.languages.cloud;
|
modelElement.querySelector(".toolbar__text").textContent = window.siyuan.languages.cloud;
|
||||||
|
|
@ -268,7 +266,6 @@ ${accountHTML}
|
||||||
} else if (target.id === "menuAccount") {
|
} else if (target.id === "menuAccount") {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
closePanel();
|
|
||||||
if (document.querySelector("#menuAccount img")) {
|
if (document.querySelector("#menuAccount img")) {
|
||||||
showAccountInfo(modelElement, modelMainElement);
|
showAccountInfo(modelElement, modelMainElement);
|
||||||
return;
|
return;
|
||||||
|
|
@ -400,7 +397,6 @@ ${accountHTML}
|
||||||
};
|
};
|
||||||
|
|
||||||
const initAbout = () => {
|
const initAbout = () => {
|
||||||
closePanel();
|
|
||||||
if (!window.siyuan.config.localIPs || window.siyuan.config.localIPs.length === 0 ||
|
if (!window.siyuan.config.localIPs || window.siyuan.config.localIPs.length === 0 ||
|
||||||
(window.siyuan.config.localIPs.length === 1 && window.siyuan.config.localIPs[0] === "")) {
|
(window.siyuan.config.localIPs.length === 1 && window.siyuan.config.localIPs[0] === "")) {
|
||||||
window.siyuan.config.localIPs = ["127.0.0.1"];
|
window.siyuan.config.localIPs = ["127.0.0.1"];
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,6 @@ const initToolbarSearch = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const popSearch = (modelElement: HTMLElement, modelMainElement: HTMLElement) => {
|
export const popSearch = (modelElement: HTMLElement, modelMainElement: HTMLElement) => {
|
||||||
closePanel();
|
|
||||||
modelElement.style.top = "0";
|
modelElement.style.top = "0";
|
||||||
modelElement.querySelector(".toolbar__icon").innerHTML = '<use xlink:href="#iconSearch"></use>';
|
modelElement.querySelector(".toolbar__icon").innerHTML = '<use xlink:href="#iconSearch"></use>';
|
||||||
modelElement.querySelector(".toolbar__text").innerHTML = '<input id="toolbarSearch" style="background-color: var(--b3-theme-surface);border: 0;" class="b3-text-field fn__block">';
|
modelElement.querySelector(".toolbar__text").innerHTML = '<input id="toolbarSearch" style="background-color: var(--b3-theme-surface);border: 0;" class="b3-text-field fn__block">';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue