mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +01:00
This commit is contained in:
parent
ecf004a1f0
commit
129f9cd3cf
5 changed files with 12 additions and 12 deletions
|
|
@ -198,6 +198,11 @@ progressLoading: 400
|
|||
background-color: var(--b3-theme-background-light);
|
||||
}
|
||||
|
||||
&--sync {
|
||||
background-color: var(--b3-theme-primary);
|
||||
color: var(--b3-theme-on-primary);
|
||||
}
|
||||
|
||||
svg {
|
||||
height: 14px;
|
||||
width: 14px;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import {addScript, addScriptSync} from "./protyle/util/addScript";
|
|||
import {genUUID} from "./util/genID";
|
||||
import {fetchGet, fetchPost} from "./util/fetch";
|
||||
import {addBaseURL, setNoteBook} from "./util/pathName";
|
||||
import {repos} from "./config/repos";
|
||||
import {openFileById} from "./editor/util";
|
||||
import {
|
||||
bootSync,
|
||||
|
|
@ -57,13 +56,9 @@ class App {
|
|||
break;
|
||||
case"syncing":
|
||||
if (data.code === 0) {
|
||||
document.querySelector("#barSync svg").classList.add("fn__rotate");
|
||||
document.querySelector("#barSync").classList.add("toolbar__item--active");
|
||||
repos.element?.querySelector('[data-type="sync"] svg')?.classList.add("fn__rotate");
|
||||
document.querySelector("#barSync").classList.add("toolbar__item--sync");
|
||||
} else {
|
||||
document.querySelector("#barSync svg").classList.remove("fn__rotate");
|
||||
document.querySelector("#barSync").classList.remove("toolbar__item--active");
|
||||
repos.element?.querySelector('[data-type="sync"] svg')?.classList.remove("fn__rotate");
|
||||
document.querySelector("#barSync").classList.remove("toolbar__item--sync");
|
||||
}
|
||||
document.querySelector("#barSync").setAttribute("aria-label", data.msg);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ export const getSyncCloudList = (cloudPanelElement: Element, reload = false, cb?
|
|||
};
|
||||
|
||||
export const syncGuide = (element?: Element) => {
|
||||
if (element && element.classList.contains("fn__rotate")) {
|
||||
if (element && element.classList.contains("toolbar__item--sync")) {
|
||||
return;
|
||||
}
|
||||
if (isMobile()) {
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ export const globalShortcut = () => {
|
|||
if (matchHotKey(window.siyuan.config.keymap.general.syncNow.custom, event)) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
syncGuide(document.querySelector("#barSync svg"));
|
||||
syncGuide(document.querySelector("#barSync"));
|
||||
return;
|
||||
}
|
||||
if (matchHotKey(window.siyuan.config.keymap.general.lockScreen.custom, event)) {
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ const initBar = () => {
|
|||
</svg>
|
||||
</div>
|
||||
<div id="barSync" class="toolbar__item b3-tooltips b3-tooltips__se" aria-label="${window.siyuan.config.sync.stat || (window.siyuan.languages.syncNow + " " + updateHotkeyTip(window.siyuan.config.keymap.general.syncNow.custom))}">
|
||||
<svg><use xlink:href="#iconRefresh"></use></svg>
|
||||
<svg><use xlink:href="#iconCloud"></use></svg>
|
||||
</div>
|
||||
<button id="barBack" data-menu="true" class="toolbar__item toolbar__item--disabled b3-tooltips b3-tooltips__se" aria-label="${window.siyuan.languages.goBack} ${updateHotkeyTip(window.siyuan.config.keymap.general.goBack.custom)}">
|
||||
<svg>
|
||||
|
|
@ -204,7 +204,7 @@ const initBar = () => {
|
|||
event.stopPropagation();
|
||||
break;
|
||||
} else if (target.id === "barSync") {
|
||||
syncGuide(target.firstElementChild);
|
||||
syncGuide(target);
|
||||
event.stopPropagation();
|
||||
break;
|
||||
} else if (target.id === "barForward") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue