mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
🚨
This commit is contained in:
parent
513031de5a
commit
5191cfd6c7
5 changed files with 14 additions and 14 deletions
|
|
@ -1250,10 +1250,10 @@ export const windowKeyDown = (app: App, event: KeyboardEvent) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const avElement = document.querySelector(".av__panel")
|
const avElement = document.querySelector(".av__panel");
|
||||||
if (avElement) {
|
if (avElement) {
|
||||||
avElement.remove();
|
avElement.remove();
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!window.siyuan.menus.menu.element.classList.contains("fn__none")) {
|
if (!window.siyuan.menus.menu.element.classList.contains("fn__none")) {
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,12 @@ const genSVGBG = () => {
|
||||||
svgs.push(item.id);
|
svgs.push(item.id);
|
||||||
});
|
});
|
||||||
Array.from({length: 45}, () => {
|
Array.from({length: 45}, () => {
|
||||||
const index = Math.floor(Math.random()*svgs.length);
|
const index = Math.floor(Math.random() * svgs.length);
|
||||||
html += `<svg><use xlink:href="#${svgs[index]}"></use></svg>`;
|
html += `<svg><use xlink:href="#${svgs[index]}"></use></svg>`;
|
||||||
svgs.splice(index, 1);
|
svgs.splice(index, 1);
|
||||||
});
|
});
|
||||||
return `<div class="fn__flex config-account__svg">${html}</div>`;
|
return `<div class="fn__flex config-account__svg">${html}</div>`;
|
||||||
}
|
};
|
||||||
|
|
||||||
export const account = {
|
export const account = {
|
||||||
element: undefined as Element,
|
element: undefined as Element,
|
||||||
|
|
|
||||||
|
|
@ -325,7 +325,7 @@ export const getColNameByType = (type: TAVCol) => {
|
||||||
case "mAsset":
|
case "mAsset":
|
||||||
return window.siyuan.languages.assets;
|
return window.siyuan.languages.assets;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
export const getColIconByType = (type: TAVCol) => {
|
export const getColIconByType = (type: TAVCol) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|
@ -650,8 +650,8 @@ const genUpdateColItem = (type: TAVCol, oldType: TAVCol, name: string) => {
|
||||||
<svg class="b3-menu__icon"><use xlink:href="#${getColIconByType(type)}"></use></svg>
|
<svg class="b3-menu__icon"><use xlink:href="#${getColIconByType(type)}"></use></svg>
|
||||||
<span class="b3-menu__label">${getColNameByType(type)}</span>
|
<span class="b3-menu__label">${getColNameByType(type)}</span>
|
||||||
${type === oldType ? '<span class="b3-menu__accelerator"><svg class="svg" style="height: 30px; float: left;"><use xlink:href="#iconSelect"></use></svg></span>' : ""}
|
${type === oldType ? '<span class="b3-menu__accelerator"><svg class="svg" style="height: 30px; float: left;"><use xlink:href="#iconSelect"></use></svg></span>' : ""}
|
||||||
</button>`
|
</button>`;
|
||||||
}
|
};
|
||||||
|
|
||||||
export const addCol = (protyle: IProtyle, blockElement: Element) => {
|
export const addCol = (protyle: IProtyle, blockElement: Element) => {
|
||||||
const menu = new Menu("av-header-add");
|
const menu = new Menu("av-header-add");
|
||||||
|
|
|
||||||
|
|
@ -109,13 +109,13 @@ export const bindDateEvent = (options: {
|
||||||
if (inputElements[3].checked) {
|
if (inputElements[3].checked) {
|
||||||
inputElements[0].setAttribute("type", "datetime-local");
|
inputElements[0].setAttribute("type", "datetime-local");
|
||||||
inputElements[1].setAttribute("type", "datetime-local");
|
inputElements[1].setAttribute("type", "datetime-local");
|
||||||
inputElements[0].value = inputElements[0].dataset.value
|
inputElements[0].value = inputElements[0].dataset.value;
|
||||||
inputElements[1].value = inputElements[1].dataset.value
|
inputElements[1].value = inputElements[1].dataset.value;
|
||||||
} else {
|
} else {
|
||||||
inputElements[0].setAttribute("type", "date");
|
inputElements[0].setAttribute("type", "date");
|
||||||
inputElements[1].setAttribute("type", "date");
|
inputElements[1].setAttribute("type", "date");
|
||||||
inputElements[0].value = inputElements[0].dataset.value.substring(0, 10)
|
inputElements[0].value = inputElements[0].dataset.value.substring(0, 10);
|
||||||
inputElements[1].value = inputElements[1].dataset.value.substring(0, 10)
|
inputElements[1].value = inputElements[1].dataset.value.substring(0, 10);
|
||||||
}
|
}
|
||||||
setDateValue({
|
setDateValue({
|
||||||
cellElements: options.cellElements,
|
cellElements: options.cellElements,
|
||||||
|
|
|
||||||
|
|
@ -601,7 +601,7 @@ export const openMenuPanel = (options: {
|
||||||
break;
|
break;
|
||||||
} else if (type === "updateColType") {
|
} else if (type === "updateColType") {
|
||||||
if (target.dataset.newType !== target.dataset.oldType) {
|
if (target.dataset.newType !== target.dataset.oldType) {
|
||||||
const name = target.dataset.name
|
const name = target.dataset.name;
|
||||||
transaction(options.protyle, [{
|
transaction(options.protyle, [{
|
||||||
action: "updateAttrViewCol",
|
action: "updateAttrViewCol",
|
||||||
id: options.colId,
|
id: options.colId,
|
||||||
|
|
@ -621,7 +621,7 @@ export const openMenuPanel = (options: {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
break;
|
break;
|
||||||
} else if (type === "goUpdateColType") {
|
} else if (type === "goUpdateColType") {
|
||||||
const editMenuElement = hasClosestByClassName(target, "b3-menu")
|
const editMenuElement = hasClosestByClassName(target, "b3-menu");
|
||||||
if (editMenuElement) {
|
if (editMenuElement) {
|
||||||
editMenuElement.firstElementChild.classList.add("fn__none");
|
editMenuElement.firstElementChild.classList.add("fn__none");
|
||||||
editMenuElement.lastElementChild.classList.remove("fn__none");
|
editMenuElement.lastElementChild.classList.remove("fn__none");
|
||||||
|
|
@ -631,7 +631,7 @@ export const openMenuPanel = (options: {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
break;
|
break;
|
||||||
} else if (type === "goEditCol") {
|
} else if (type === "goEditCol") {
|
||||||
const editMenuElement = hasClosestByClassName(target, "b3-menu")
|
const editMenuElement = hasClosestByClassName(target, "b3-menu");
|
||||||
if (editMenuElement) {
|
if (editMenuElement) {
|
||||||
editMenuElement.firstElementChild.classList.remove("fn__none");
|
editMenuElement.firstElementChild.classList.remove("fn__none");
|
||||||
editMenuElement.lastElementChild.classList.add("fn__none");
|
editMenuElement.lastElementChild.classList.add("fn__none");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue