mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-19 16:10:12 +01:00
♻️ wnd tab 下拉图标
This commit is contained in:
parent
a7e6164f0e
commit
7acdb158f2
7 changed files with 19 additions and 13 deletions
|
|
@ -246,14 +246,6 @@
|
|||
margin-right: 8px;
|
||||
color: var(--b3-theme-on-surface);
|
||||
|
||||
// 分屏下拉的页签列表
|
||||
& > svg,
|
||||
& > img {
|
||||
float: left;
|
||||
height: 14px;
|
||||
width: 14px;
|
||||
}
|
||||
|
||||
&--arrow {
|
||||
margin: 0 0 0 8px;
|
||||
height: 10px;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ import {hideAllElements} from "../protyle/ui/hideElements";
|
|||
import {focusByOffset, getSelectionOffset} from "../protyle/util/selection";
|
||||
import {Custom} from "./dock/Custom";
|
||||
import {App} from "../index";
|
||||
import {unicode2Emoji} from "../emoji";
|
||||
|
||||
export class Wnd {
|
||||
private app: App;
|
||||
|
|
@ -579,10 +580,23 @@ export class Wnd {
|
|||
Array.from(this.headersElement.children).forEach((item: HTMLElement) => {
|
||||
const iconElement = item.querySelector(".item__icon");
|
||||
const graphicElement = item.querySelector(".item__graphic");
|
||||
let iconHTML = undefined
|
||||
if (iconElement) {
|
||||
if (iconElement.firstElementChild?.tagName === "IMG") {
|
||||
// 图标为图片的文档
|
||||
iconHTML = `<img src="${iconElement.firstElementChild.getAttribute("src")}" class="b3-menu__icon">`
|
||||
} else {
|
||||
// 有图标的文档
|
||||
iconHTML = `<span class="b3-menu__icon">${iconElement.innerHTML}</span>`
|
||||
}
|
||||
} else if (!graphicElement) {
|
||||
// 没有图标的文档
|
||||
iconHTML = unicode2Emoji(Constants.SIYUAN_IMAGE_FILE, "b3-menu__icon", true)
|
||||
}
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: escapeHtml(item.querySelector(".item__text").textContent),
|
||||
action: "iconCloseRound",
|
||||
iconHTML: iconElement ? `<span class="b3-menu__icon">${iconElement.innerHTML}</span>` : "",
|
||||
iconHTML,
|
||||
icon: graphicElement ? graphicElement.firstElementChild.getAttribute("xlink:href").substring(1) : "",
|
||||
bind: (element) => {
|
||||
element.addEventListener("click", (itemEvent) => {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import {webFrame} from "electron";
|
|||
/// #endif
|
||||
import {Constants} from "../constants";
|
||||
import {isBrowser, isWindow} from "../util/functions";
|
||||
import {Menu} from "../plugin/Meun";
|
||||
import {Menu} from "../plugin/Menu";
|
||||
import {fetchPost} from "../util/fetch";
|
||||
import {escapeAttr} from "../util/escape";
|
||||
import {needSubscribe} from "../util/needSubscribe";
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import {App} from "../index";
|
|||
import {Constants} from "../constants";
|
||||
import {Model} from "../layout/Model";
|
||||
import {Setting} from "./Setting";
|
||||
import {Menu} from "./Meun";
|
||||
import {Menu} from "./Menu";
|
||||
|
||||
let openTab;
|
||||
/// #if MOBILE
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import {Menu} from "../../../plugin/Meun";
|
||||
import {Menu} from "../../../plugin/Menu";
|
||||
import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName} from "../../util/hasClosest";
|
||||
import {transaction} from "../../wysiwyg/transaction";
|
||||
import {openEditorTab} from "../../../menus/util";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import {transaction} from "../../wysiwyg/transaction";
|
||||
import {hasClosestBlock} from "../../util/hasClosest";
|
||||
import {Menu} from "../../../plugin/Meun";
|
||||
import {Menu} from "../../../plugin/Menu";
|
||||
import {getColIconByType} from "./col";
|
||||
|
||||
export const popTextCell = (protyle: IProtyle, cellElement: HTMLElement) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue