mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
e382f4925d
commit
251a1cfcd4
1 changed files with 0 additions and 33 deletions
|
|
@ -25,39 +25,6 @@ import {getContenteditableElement} from "../protyle/wysiwyg/getBlock";
|
||||||
import {updatePanelByEditor} from "../editor/util";
|
import {updatePanelByEditor} from "../editor/util";
|
||||||
import {Constants} from "../constants";
|
import {Constants} from "../constants";
|
||||||
import {openSearch} from "../search/spread";
|
import {openSearch} from "../search/spread";
|
||||||
import {Dialog} from "../dialog";
|
|
||||||
import {isMobile} from "../util/functions";
|
|
||||||
|
|
||||||
export const openCloseRecentTab = () => {
|
|
||||||
const recentClose = JSON.parse(localStorage.getItem(Constants.LOCAL_RECENTCLOSE) || "[]");
|
|
||||||
let html = ''
|
|
||||||
if (recentClose.length === 0) {
|
|
||||||
html += `<li class="b3-list-item b3-list--empty">${window.siyuan.languages.emptyContent}</li>`
|
|
||||||
} else {
|
|
||||||
recentClose.forEach((item: IObject) => {
|
|
||||||
html += `<li class="b3-list-item" data-instance="${item.instance}">${item.text}</li>`
|
|
||||||
})
|
|
||||||
}
|
|
||||||
const dialog = new Dialog({
|
|
||||||
title: window.siyuan.languages.recentClose,
|
|
||||||
content: `<div class="fn__flex-column" style="height: 100%;max-height: 70vh;">
|
|
||||||
<ul class="b3-list b3-list--background fn__flex-1">${html}</ul>
|
|
||||||
<div class="fn__hr"></div>
|
|
||||||
</div>`,
|
|
||||||
width: isMobile() ? "80vw" : "50vw",
|
|
||||||
});
|
|
||||||
dialog.element.addEventListener("click", (event) => {
|
|
||||||
let target = event.target as HTMLElement
|
|
||||||
while (!target.isSameNode(dialog.element)) {
|
|
||||||
const instance = target.getAttribute("data-instance")
|
|
||||||
if (instance) {
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
target = target.parentElement
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export const setPanelFocus = (element: Element) => {
|
export const setPanelFocus = (element: Element) => {
|
||||||
if (element.classList.contains("block__icons--active") || element.classList.contains("layout__wnd--active")) {
|
if (element.classList.contains("block__icons--active") || element.classList.contains("layout__wnd--active")) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue