Skip to content

Commit

Permalink
🎨 #9751
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Dec 1, 2023
1 parent b99c89f commit aba4169
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
4 changes: 4 additions & 0 deletions app/src/assets/scss/business/_av.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
}
}

&__views {
align-items: center;
}

&__title {
outline: none;
font-weight: bold;
Expand Down
6 changes: 3 additions & 3 deletions app/src/boot/globalEvent/keydown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ const fileTreeKeydown = (app: App, event: KeyboardEvent) => {
if (matchHotKey(window.siyuan.config.keymap.general.selectOpen1.custom, event)) {
event.preventDefault();
const element = document.querySelector(".layout__wnd--active > .fn__flex > .layout-tab-bar > .item--focus") ||
document.querySelector(".layout-tab-bar > .item--focus");
document.querySelector("ul.layout-tab-bar > .item--focus");
if (element) {
const tab = getInstanceById(element.getAttribute("data-id")) as Tab;
if (tab && tab.model instanceof Editor) {
Expand Down Expand Up @@ -1119,9 +1119,9 @@ export const windowKeyDown = (app: App, event: KeyboardEvent) => {
return;
}
let tabHtml = "";
let currentTabElement = document.querySelector(".layout__wnd--active .layout-tab-bar > .item--focus");
let currentTabElement = document.querySelector(".layout__wnd--active ul.layout-tab-bar > .item--focus");
if (!currentTabElement) {
currentTabElement = document.querySelector(".layout-tab-bar > .item--focus");
currentTabElement = document.querySelector("ul.layout-tab-bar > .item--focus");
}
if (currentTabElement) {
const currentId = currentTabElement.getAttribute("data-id");
Expand Down
2 changes: 1 addition & 1 deletion app/src/layout/dock/Files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export class Files extends Model {
break;
} else if (type === "focus") {
const element = document.querySelector(".layout__wnd--active > .fn__flex > .layout-tab-bar > .item--focus") ||
document.querySelector(".layout-tab-bar > .item--focus");
document.querySelector("ul.layout-tab-bar > .item--focus");
if (element) {
const tab = getInstanceById(element.getAttribute("data-id")) as Tab;
if (tab && tab.model instanceof Editor) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/layout/dock/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ export class Dock {
}
// 关闭 dock 后设置光标
if (!document.querySelector(".layout__center .layout__wnd--active")) {
const currentElement = document.querySelector(".layout__center .layout-tab-bar .item--focus");
const currentElement = document.querySelector(".layout__center ul.layout-tab-bar .item--focus");
if (currentElement) {
getAllTabs().find(item => {
if (item.id === currentElement.getAttribute("data-id")) {
Expand Down
2 changes: 1 addition & 1 deletion app/src/protyle/render/av/openMenuPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const openMenuPanel = (options: {
</div>`);
avPanelElement = document.querySelector(".av__panel");
const menuElement = avPanelElement.lastElementChild as HTMLElement;
const tabRect = options.blockElement.querySelector(".layout-tab-bar")?.getBoundingClientRect();
const tabRect = options.blockElement.querySelector(".av__views")?.getBoundingClientRect();
if (["select", "date", "asset"].includes(options.type)) {
const cellRect = options.cellElements[options.cellElements.length - 1].getBoundingClientRect();
if (options.type === "select") {
Expand Down
14 changes: 7 additions & 7 deletions app/src/protyle/render/av/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,33 +215,33 @@ ${cell.color ? `color:${cell.color};` : ""}">${text}</div>`;
setTimeout(() => {
e.firstElementChild.outerHTML = `<div class="av__container" style="--av-background:${e.style.backgroundColor || "var(--b3-theme-background)"}">
<div class="av__header">
<div class="fn__flex">
<div class="fn__flex av__views">
<div class="layout-tab-bar fn__flex">
${tabHTML}
</div>
<div class="fn__space"></div>
<span data-type="av-add" class="block__icon fn__flex-center">
<span data-type="av-add" class="block__icon">
<svg><use xlink:href="#iconAdd"></use></svg>
</span>
<div class="fn__flex-1"></div>
<div class="fn__space"></div>
<span data-type="av-switcher" class="block__icon fn__flex-center${response.data.views.length > 0 ? "" : " fn__none"}">
<span data-type="av-switcher" class="block__icon${response.data.views.length > 0 ? "" : " fn__none"}">
<svg><use xlink:href="#iconDown"></use></svg>
</span>
<div class="fn__space"></div>
<span data-type="av-filter" class="block__icon fn__flex-center${data.filters.length > 0 ? " block__icon--active" : ""}">
<span data-type="av-filter" class="block__icon${data.filters.length > 0 ? " block__icon--active" : ""}">
<svg><use xlink:href="#iconFilter"></use></svg>
</span>
<div class="fn__space"></div>
<span data-type="av-sort" class="block__icon fn__flex-center${data.sorts.length > 0 ? " block__icon--active" : ""}">
<span data-type="av-sort" class="block__icon${data.sorts.length > 0 ? " block__icon--active" : ""}">
<svg><use xlink:href="#iconSort"></use></svg>
</span>
<div class="fn__space"></div>
<span data-type="av-more" class="block__icon fn__flex-center">
<span data-type="av-more" class="block__icon">
<svg><use xlink:href="#iconMore"></use></svg>
</span>
<div class="fn__space"></div>
${response.data.isMirror ? ` <span class="block__icon fn__flex-center block__icon--show ariaLabel" aria-label="${window.siyuan.languages.mirrorTip}">
${response.data.isMirror ? ` <span class="block__icon block__icon--show ariaLabel" aria-label="${window.siyuan.languages.mirrorTip}">
<svg><use xlink:href="#iconSplitLR"></use></svg></span><div class="fn__space"></div>` : ""}
</div>
<div contenteditable="${protyle.disabled ? "false" : "true"}" spellcheck="${window.siyuan.config.editor.spellcheck.toString()}" class="av__title" data-title="${response.data.name || ""}" data-tip="${window.siyuan.languages.title}">${response.data.name || ""}</div>
Expand Down

0 comments on commit aba4169

Please sign in to comment.