mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 00:38:49 +01:00
This commit is contained in:
parent
9741a0c843
commit
31ebdeb4dd
10 changed files with 37 additions and 45 deletions
|
|
@ -233,17 +233,14 @@
|
|||
&:hover,
|
||||
&.item--focus {
|
||||
.item__close svg {
|
||||
opacity: 1;
|
||||
opacity: .68;
|
||||
}
|
||||
}
|
||||
|
||||
&--readonly {
|
||||
padding-left: 13px;
|
||||
padding-right: 8px;
|
||||
max-width: none;
|
||||
|
||||
.item__close svg {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
&--pin {
|
||||
|
|
@ -320,18 +317,15 @@
|
|||
align-items: center;
|
||||
|
||||
svg {
|
||||
border-radius: 10px;
|
||||
height: 8px;
|
||||
width: 8px;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
color: var(--b3-theme-on-surface);
|
||||
transition: var(--b3-transition);
|
||||
padding: 4px;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
&:hover svg {
|
||||
color: var(--b3-theme-on-background);
|
||||
background-color: var(--b3-theme-background-light);
|
||||
opacity: 1 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ a.b3-chip:hover {
|
|||
width: 16px;
|
||||
transition: var(--b3-transition);
|
||||
cursor: pointer;
|
||||
opacity: .38;
|
||||
opacity: .68;
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
|
|
|
|||
|
|
@ -79,7 +79,13 @@
|
|||
cursor: pointer;
|
||||
top: 10px;
|
||||
right: -32px;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
height: 18px;
|
||||
width: 18px;
|
||||
opacity: .68;
|
||||
color: var(--b3-theme-on-surface);
|
||||
|
||||
&:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@
|
|||
background-color: var(--b3-list-hover);
|
||||
|
||||
& > .b3-menu__action {
|
||||
opacity: 1;
|
||||
opacity: .68;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -215,17 +215,14 @@
|
|||
|
||||
&__action {
|
||||
opacity: 0;
|
||||
color: var(--b3-theme-on-surface);
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
align-self: center;
|
||||
margin-left: 8px;
|
||||
padding: 4px;
|
||||
border-radius: 8px;
|
||||
color: var(--b3-theme-on-surface);
|
||||
|
||||
&:hover {
|
||||
color: var(--b3-theme-on-background);
|
||||
background: var(--b3-theme-background-light);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -80,12 +80,6 @@
|
|||
margin: 6px 4px;
|
||||
color: var(--b3-theme-on-surface);
|
||||
|
||||
&--small {
|
||||
height: 14px;
|
||||
width: 14px;
|
||||
padding: 11px 8px;
|
||||
}
|
||||
|
||||
&[disabled] {
|
||||
opacity: 0.38;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,10 +48,10 @@
|
|||
<div id="menu" class="b3-menu b3-menu--fullscreen"></div>
|
||||
<div id="model" class="side-panel side-panel--all fn__flex-column">
|
||||
<div class="toolbar toolbar--border">
|
||||
<svg class="toolbar__icon toolbar__icon--small"><use xlink:href="#iconMenu"></use></svg>
|
||||
<svg class="toolbar__icon"><use xlink:href="#iconMenu"></use></svg>
|
||||
<span class="toolbar__text"></span>
|
||||
<svg id="modelClose" class="toolbar__icon toolbar__icon--small">
|
||||
<use xlink:href="#iconClose"></use>
|
||||
<svg id="modelClose" class="toolbar__icon">
|
||||
<use xlink:href="#iconCloseRound"></use>
|
||||
</svg>
|
||||
</div>
|
||||
<div id="modelMain" class="fn__flex-1"></div>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export class Dialog {
|
|||
this.element.innerHTML = `<div class="b3-dialog">
|
||||
<div class="b3-dialog__scrim"${options.transparent ? 'style="background-color:transparent"' : ""}></div>
|
||||
<div class="b3-dialog__container" style="width:${options.width || "auto"}">
|
||||
<svg class="b3-dialog__close fn__a${this.disableClose ? " fn__none" : ""}"><use xlink:href="#iconClose"></use></svg>
|
||||
<svg class="b3-dialog__close${this.disableClose ? " fn__none" : ""}"><use xlink:href="#iconCloseRound"></use></svg>
|
||||
<div class="b3-dialog__header${options.title ? "" : " fn__none"}" onselectstart="return false;">${options.title || ""}</div>
|
||||
<div style="height:${options.height || "auto"}">${options.content}</div>
|
||||
</div></div>`;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ export class Tab {
|
|||
iconHTML = `<span class="item__icon">${unicode2Emoji(options.docIcon)}</span>`;
|
||||
}
|
||||
this.headElement.innerHTML = `${iconHTML}<span class="item__text">${escapeHtml(options.title)}</span>
|
||||
<span class="item__close"><svg><use xlink:href='#iconClose'></use></svg></span>`;
|
||||
<span class="item__close"><svg><use xlink:href="#iconCloseRound"></use></svg></span>`;
|
||||
this.headElement.addEventListener("mouseenter", (event) => {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@ export class Wnd {
|
|||
<ul class="fn__flex layout-tab-bar"></ul>
|
||||
<ul class="layout-tab-bar layout-tab-bar--readonly fn__flex-1">
|
||||
<li class="item item--readonly">
|
||||
<span data-type="new" class="item__close" title="${window.siyuan.languages.newFile}"><svg style="height: 10px;width: 10px;padding: 3px"><use xlink:href="#iconAdd"></use></svg></span>
|
||||
<span data-type="new" class="block__icon block__icon--show" title="${window.siyuan.languages.newFile}"><svg><use xlink:href="#iconAdd"></use></svg></span>
|
||||
<span class="fn__flex-1"></span>
|
||||
<span data-type="more" data-menu="true" class="item__close" title="${window.siyuan.languages.more}"><svg><use xlink:href="#iconDown"></use></svg></span>
|
||||
<span data-type="more" data-menu="true" class="block__icon block__icon--show" title="${window.siyuan.languages.more}"><svg><use xlink:href="#iconDown"></use></svg></span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -93,11 +93,11 @@ export class Wnd {
|
|||
this.headersElement.parentElement.addEventListener("click", (event) => {
|
||||
let target = event.target as HTMLElement;
|
||||
while (target && !target.isEqualNode(this.headersElement)) {
|
||||
if (target.classList.contains("item__close") && target.getAttribute("data-type") === "new") {
|
||||
if (target.classList.contains("block__icon") && target.getAttribute("data-type") === "new") {
|
||||
setPanelFocus(this.headersElement.parentElement.parentElement);
|
||||
newFile(undefined, undefined, undefined, true);
|
||||
break;
|
||||
} else if (target.classList.contains("item__close") && target.getAttribute("data-type") === "more") {
|
||||
} else if (target.classList.contains("block__icon") && target.getAttribute("data-type") === "more") {
|
||||
this.renderTabList(event);
|
||||
break;
|
||||
} else if (target.tagName === "LI" && target.getAttribute("data-id") && !pdfIsLoading(this.element)) {
|
||||
|
|
@ -560,12 +560,12 @@ export class Wnd {
|
|||
const graphicElement = item.querySelector(".item__graphic");
|
||||
window.siyuan.menus.menu.append(new MenuItem({
|
||||
label: escapeHtml(item.querySelector(".item__text").textContent),
|
||||
action: "iconClose",
|
||||
action: "iconCloseRound",
|
||||
iconHTML: iconElement ? `<span class="b3-menu__icon">${iconElement.innerHTML}</span>` : "",
|
||||
icon: graphicElement ? graphicElement.firstElementChild.getAttribute("xlink:href").substring(1) : "",
|
||||
bind: (element) => {
|
||||
element.addEventListener("click", (event) => {
|
||||
if (hasClosestByTag(event.target as Element, "svg")) {
|
||||
if (hasClosestByClassName(event.target as Element, "b3-menu__action")) {
|
||||
this.removeTab(item.getAttribute("data-id"));
|
||||
if (element.previousElementSibling || element.nextElementSibling) {
|
||||
element.remove();
|
||||
|
|
|
|||
|
|
@ -152,14 +152,11 @@ export const workspaceMenu = (rect: DOMRect) => {
|
|||
window.siyuan.storage[Constants.LOCAL_LAYOUTS].forEach((item: ISaveLayout) => {
|
||||
layoutSubMenu.push({
|
||||
iconHTML: Constants.ZWSP,
|
||||
label: `<div class="fn__flex">
|
||||
<span class="fn__flex-1">${item.name}</span>
|
||||
<span class="fn__space"></span>
|
||||
<svg class="b3-menu__icon fn__a" style="width: 8px"><use xlink:href="#iconClose"></use></svg>
|
||||
</div>`,
|
||||
action:"iconCloseRound",
|
||||
label: item.name,
|
||||
bind(menuElement) {
|
||||
menuElement.addEventListener("click", (event) => {
|
||||
if (hasClosestByClassName(event.target as HTMLElement, "fn__a")) {
|
||||
if (hasClosestByClassName(event.target as Element, "b3-menu__action")) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
window.siyuan.storage[Constants.LOCAL_LAYOUTS].find((layoutItem: ISaveLayout, index: number) => {
|
||||
|
|
@ -316,22 +313,26 @@ const workspaceItem = (item: IWorkspace) => {
|
|||
iconHTML: Constants.ZWSP,
|
||||
type: "submenu",
|
||||
submenu: [{
|
||||
iconHTML: Constants.ZWSP,
|
||||
label: window.siyuan.languages.openBy,
|
||||
click() {
|
||||
openWorkspace(item.path);
|
||||
}
|
||||
}, {
|
||||
iconHTML: Constants.ZWSP,
|
||||
label: window.siyuan.languages.showInFolder,
|
||||
click() {
|
||||
shell.showItemInFolder(item.path);
|
||||
}
|
||||
}, {
|
||||
iconHTML: Constants.ZWSP,
|
||||
label: window.siyuan.languages.copyPath,
|
||||
click() {
|
||||
writeText(item.path);
|
||||
showMessage(window.siyuan.languages.copied);
|
||||
}
|
||||
}, {
|
||||
iconHTML: Constants.ZWSP,
|
||||
label: window.siyuan.languages.removeWorkspaceTip,
|
||||
click() {
|
||||
fetchPost("/api/system/removeWorkspaceDir", {path: item.path});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue