mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
This commit is contained in:
parent
f300d30a47
commit
f8b7d1539b
1 changed files with 5 additions and 5 deletions
|
|
@ -102,7 +102,7 @@ export const openMenuPanel = (options: {
|
||||||
} else if (targetElement.querySelector('[data-type="removeFilter"]')) {
|
} else if (targetElement.querySelector('[data-type="removeFilter"]')) {
|
||||||
type = "filters";
|
type = "filters";
|
||||||
} else if (targetElement.querySelector('[data-type="setColOption"]')) {
|
} else if (targetElement.querySelector('[data-type="setColOption"]')) {
|
||||||
const colId = options.cellElements ? options.cellElements[0].dataset.colId : menuElement.firstElementChild.getAttribute("data-col-id");
|
const colId = options.cellElements ? options.cellElements[0].dataset.colId : menuElement.querySelector(".b3-menu__item").getAttribute("data-col-id");
|
||||||
const changeData = data.view.columns.find((column) => column.id === colId).options;
|
const changeData = data.view.columns.find((column) => column.id === colId).options;
|
||||||
const oldData = Object.assign([], changeData);
|
const oldData = Object.assign([], changeData);
|
||||||
let targetOption: { name: string, color: string };
|
let targetOption: { name: string, color: string };
|
||||||
|
|
@ -510,7 +510,7 @@ export const openMenuPanel = (options: {
|
||||||
break;
|
break;
|
||||||
} else if (type === "hideCol") {
|
} else if (type === "hideCol") {
|
||||||
const isEdit = menuElement.querySelector('[data-type="goProperties"]');
|
const isEdit = menuElement.querySelector('[data-type="goProperties"]');
|
||||||
const colId = isEdit ? menuElement.firstElementChild.getAttribute("data-col-id") : target.parentElement.getAttribute("data-id");
|
const colId = isEdit ? menuElement.querySelector(".b3-menu__item").getAttribute("data-col-id") : target.parentElement.getAttribute("data-id");
|
||||||
transaction(options.protyle, [{
|
transaction(options.protyle, [{
|
||||||
action: "setAttrViewColHidden",
|
action: "setAttrViewColHidden",
|
||||||
id: colId,
|
id: colId,
|
||||||
|
|
@ -539,7 +539,7 @@ export const openMenuPanel = (options: {
|
||||||
break;
|
break;
|
||||||
} else if (type === "showCol") {
|
} else if (type === "showCol") {
|
||||||
const isEdit = menuElement.querySelector('[data-type="goProperties"]');
|
const isEdit = menuElement.querySelector('[data-type="goProperties"]');
|
||||||
const colId = isEdit ? menuElement.firstElementChild.getAttribute("data-col-id") : target.parentElement.getAttribute("data-id");
|
const colId = isEdit ? menuElement.querySelector(".b3-menu__item").getAttribute("data-col-id") : target.parentElement.getAttribute("data-id");
|
||||||
transaction(options.protyle, [{
|
transaction(options.protyle, [{
|
||||||
action: "setAttrViewColHidden",
|
action: "setAttrViewColHidden",
|
||||||
id: colId,
|
id: colId,
|
||||||
|
|
@ -567,7 +567,7 @@ export const openMenuPanel = (options: {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
break;
|
break;
|
||||||
} else if (type === "duplicateCol") {
|
} else if (type === "duplicateCol") {
|
||||||
const colId = menuElement.firstElementChild.getAttribute("data-col-id");
|
const colId = menuElement.querySelector(".b3-menu__item").getAttribute("data-col-id");
|
||||||
const colData = data.view.columns.find((item: IAVColumn) => item.id === colId);
|
const colData = data.view.columns.find((item: IAVColumn) => item.id === colId);
|
||||||
duplicateCol({
|
duplicateCol({
|
||||||
protyle: options.protyle,
|
protyle: options.protyle,
|
||||||
|
|
@ -582,7 +582,7 @@ export const openMenuPanel = (options: {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
break;
|
break;
|
||||||
} else if (type === "removeCol") {
|
} else if (type === "removeCol") {
|
||||||
const colId = menuElement.firstElementChild.getAttribute("data-col-id");
|
const colId = menuElement.querySelector(".b3-menu__item").getAttribute("data-col-id");
|
||||||
const colData = data.view.columns.find((item: IAVColumn) => item.id === colId);
|
const colData = data.view.columns.find((item: IAVColumn) => item.id === colId);
|
||||||
transaction(options.protyle, [{
|
transaction(options.protyle, [{
|
||||||
action: "removeAttrViewCol",
|
action: "removeAttrViewCol",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue