mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-18 21:18:07 +01:00
This commit is contained in:
parent
10f408513d
commit
fadd3c2120
5 changed files with 41 additions and 3 deletions
|
|
@ -1578,6 +1578,31 @@ export const openMenuPanel = (options: {
|
|||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
break;
|
||||
} else if (type === "hideGroups") {
|
||||
window.siyuan.menus.menu.remove();
|
||||
const useElement = target.querySelector("use");
|
||||
const isShow = useElement.getAttribute("xlink:href") === "#iconEyeoff";
|
||||
target.innerHTML = `${window.siyuan.languages[isShow ? "showAll" : "hideAll"]}
|
||||
<span class="fn__space"></span>
|
||||
<svg><use xlink:href="#iconEye${isShow ? "" : "off"}"></use></svg>`;
|
||||
data.view.groups.forEach((item) => {
|
||||
item.groupHidden = isShow ? 2 : 0;
|
||||
target.parentElement.querySelector(`.b3-menu__item[data-id="${item.id}"] .b3-menu__action use`)?.setAttribute("xlink:href", `iconEye${isShow ? "" : "off"}`);
|
||||
});
|
||||
transaction(options.protyle, [{
|
||||
action: "hideAttrViewAllGroups",
|
||||
avID: data.id,
|
||||
blockID,
|
||||
data: isShow,
|
||||
}], [{
|
||||
action: "hideAttrViewAllGroups",
|
||||
avID: data.id,
|
||||
blockID,
|
||||
data: !isShow
|
||||
}]);
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
break;
|
||||
} else if (type === "removeGroups") {
|
||||
window.siyuan.menus.menu.remove();
|
||||
transaction(options.protyle, [{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue