mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 08:00:13 +01:00
This commit is contained in:
parent
bf3137a93f
commit
3c3b612e1d
4 changed files with 34 additions and 1 deletions
|
|
@ -294,6 +294,24 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.status {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
transition: var(--b3-transition);
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--b3-theme-on-surface);
|
||||||
|
padding: 4px;
|
||||||
|
white-space: nowrap;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: var(--b3-theme-surface);
|
||||||
|
@extend .fn__ellipsis;
|
||||||
|
|
||||||
|
&--hide {
|
||||||
|
bottom: -30px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 620px) {
|
@media (max-width: 620px) {
|
||||||
.protyle-wysiwyg [data-node-id].sb[data-sb-layout="col"] {
|
.protyle-wysiwyg [data-node-id].sb[data-sb-layout="col"] {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
|
||||||
|
|
@ -54,5 +54,6 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="commonMenu" class="b3-menu fn__none"></div>
|
<div id="commonMenu" class="b3-menu fn__none"></div>
|
||||||
<div id="message" class="b3-snackbars"></div>
|
<div id="message" class="b3-snackbars"></div>
|
||||||
|
<div id="status" class="status status--hide"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,18 @@ export const transactionError = (data: { code: number, data: string }) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let progressStatusTimeoutId: number
|
||||||
export const progressStatus = (data: IWebSocketData) => {
|
export const progressStatus = (data: IWebSocketData) => {
|
||||||
|
if (isMobile()) {
|
||||||
|
clearTimeout(progressStatusTimeoutId);
|
||||||
|
const statusElement = document.querySelector("#status")
|
||||||
|
statusElement.innerHTML = data.msg;
|
||||||
|
statusElement.classList.remove("status--hide")
|
||||||
|
progressStatusTimeoutId = window.setTimeout(() => {
|
||||||
|
statusElement.classList.add("status--hide");
|
||||||
|
}, 6000);
|
||||||
|
return;
|
||||||
|
}
|
||||||
document.querySelector("#status .status__msg").innerHTML = data.msg;
|
document.querySelector("#status .status__msg").innerHTML = data.msg;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import {openMobileFileById} from "../editor";
|
import {openMobileFileById} from "../editor";
|
||||||
import {progressLoading, transactionError} from "../../dialog/processSystem";
|
import {progressLoading, progressStatus, transactionError} from "../../dialog/processSystem";
|
||||||
|
|
||||||
export const onMessage = (data: IWebSocketData) => {
|
export const onMessage = (data: IWebSocketData) => {
|
||||||
if (data) {
|
if (data) {
|
||||||
|
|
@ -23,6 +23,9 @@ export const onMessage = (data: IWebSocketData) => {
|
||||||
case"txerr":
|
case"txerr":
|
||||||
transactionError(data);
|
transactionError(data);
|
||||||
break;
|
break;
|
||||||
|
case"statusbar":
|
||||||
|
progressStatus(data);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue