mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-08 05:32:33 +01:00
This commit is contained in:
parent
3a43c97684
commit
17283d696a
6 changed files with 106 additions and 111 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// "gutter", "toolbar", "select", "hint", "util", "dialog"
|
||||
export const hideElements = (panels: string[], protyle?: IProtyle) => {
|
||||
export const hideElements = (panels: string[], protyle?: IProtyle, focusHide = false) => {
|
||||
if (!protyle) {
|
||||
if (panels.includes("dialog")) {
|
||||
for (let i = 0; i < window.siyuan.dialogs.length; i++) {
|
||||
|
|
@ -27,8 +27,12 @@ export const hideElements = (panels: string[], protyle?: IProtyle) => {
|
|||
}
|
||||
if (protyle.toolbar && panels.includes("util")) {
|
||||
const pinElement = protyle.toolbar.subElement.querySelector('[data-type="pin"]');
|
||||
if (!pinElement || (pinElement && !pinElement.classList.contains("block__icon--active"))) {
|
||||
if (focusHide || !pinElement || (pinElement && !pinElement.classList.contains("block__icon--active"))) {
|
||||
protyle.toolbar.subElement.classList.add("fn__none");
|
||||
if (protyle.toolbar.subElementCloseCB) {
|
||||
protyle.toolbar.subElementCloseCB();
|
||||
protyle.toolbar.subElementCloseCB = undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (panels.includes("select")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue