This commit is contained in:
Vanessa 2023-07-31 23:59:02 +08:00
parent 9e57253528
commit b27460fe90
3 changed files with 10 additions and 10 deletions

View File

@ -352,7 +352,7 @@ export class Files extends Model {
selectElements.forEach((item: HTMLElement, index) => { selectElements.forEach((item: HTMLElement, index) => {
ghostElement.append(item.cloneNode(true)); ghostElement.append(item.cloneNode(true));
item.style.opacity = "0.1"; item.style.opacity = "0.1";
const itemNodeId = item.getAttribute("data-node-id") || "" const itemNodeId = item.getAttribute("data-node-id") || "";
if (itemNodeId) { if (itemNodeId) {
ids += itemNodeId; ids += itemNodeId;
if (index < selectElements.length - 1) { if (index < selectElements.length - 1) {

View File

@ -3,7 +3,7 @@ import {shell} from "electron";
/// #endif /// #endif
import {confirmDialog} from "../dialog/confirmDialog"; import {confirmDialog} from "../dialog/confirmDialog";
import {getSearch, isMobile, isValidAttrName} from "../util/functions"; import {getSearch, isMobile, isValidAttrName} from "../util/functions";
import {isLocalPath, movePathTo, moveToPath, pathPosix, setNotebookName} from "../util/pathName"; import {isLocalPath, movePathTo, moveToPath, pathPosix} from "../util/pathName";
import {MenuItem} from "./Menu"; import {MenuItem} from "./Menu";
import {saveExport} from "../protyle/export"; import {saveExport} from "../protyle/export";
import {openByMobile, writeText} from "../protyle/util/compatibility"; import {openByMobile, writeText} from "../protyle/util/compatibility";
@ -319,7 +319,7 @@ const genAttr = (attrs: IObject, focusName = "bookmark") => {
}); });
btnsElement[1].addEventListener("click", () => { btnsElement[1].addEventListener("click", () => {
if (!isValidAttrName(inputElement.value)) { if (!isValidAttrName(inputElement.value)) {
showMessage(window.siyuan.languages.attrName + " <b>" + inputElement.value + "</b> " + window.siyuan.languages.invalid) showMessage(window.siyuan.languages.attrName + " <b>" + inputElement.value + "</b> " + window.siyuan.languages.invalid);
return false; return false;
} }
target.parentElement.insertAdjacentHTML("beforebegin", `<div class="b3-label b3-label--noborder"> target.parentElement.insertAdjacentHTML("beforebegin", `<div class="b3-label b3-label--noborder">

View File

@ -264,25 +264,25 @@ export const renderAVAttribute = (element: HTMLElement, id: string) => {
element.innerHTML = html; element.innerHTML = html;
element.querySelectorAll(".b3-text-field--text").forEach((item: HTMLInputElement) => { element.querySelectorAll(".b3-text-field--text").forEach((item: HTMLInputElement) => {
item.addEventListener("change", () => { item.addEventListener("change", () => {
let value let value;
if (item.parentElement.dataset.type === "url") { if (item.parentElement.dataset.type === "url") {
value = { value = {
url: { url: {
content: item.value content: item.value
} }
} };
} else if (item.parentElement.dataset.type === "text") { } else if (item.parentElement.dataset.type === "text") {
value = { value = {
text: { text: {
content: item.value content: item.value
} }
} };
} else if (item.parentElement.dataset.type === "number") { } else if (item.parentElement.dataset.type === "number") {
value = { value = {
number: { number: {
content: parseFloat(item.value) content: parseFloat(item.value)
} }
} };
} }
fetchPost("/api/av/setAttributeViewBlockAttr", { fetchPost("/api/av/setAttributeViewBlockAttr", {
avID: item.parentElement.dataset.avId, avID: item.parentElement.dataset.avId,
@ -290,8 +290,8 @@ export const renderAVAttribute = (element: HTMLElement, id: string) => {
rowID: item.parentElement.dataset.blockId, rowID: item.parentElement.dataset.blockId,
cellID: id, cellID: id,
value value
}) });
}) });
}) });
}); });
}; };