Vanessa 2024-04-22 13:46:27 +08:00
parent 81af862457
commit cf85b7e0ed
6 changed files with 15 additions and 7 deletions

View file

@ -4,7 +4,7 @@ import {Constants} from "../../../constants";
import {addDragFill, renderCell} from "./cell";
import {unicode2Emoji} from "../../../emoji";
import {focusBlock} from "../../util/selection";
import {hasClosestBlock, hasClosestByClassName} from "../../util/hasClosest";
import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName} from "../../util/hasClosest";
import {stickyRow} from "./row";
import {getCalcValue} from "./calc";
import {renderAVAttribute} from "./blockAttr";
@ -191,8 +191,13 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex)}
viewData = item;
}
});
e.firstElementChild.outerHTML = `<div class="av__container" style="--av-background:${e.style.backgroundColor || "var(--b3-theme-background)"}">
let avBackground = '--av-background:var(--b3-theme-background)'
if (e.style.backgroundColor) {
avBackground = avBackground + e.style.backgroundColor
} else if (hasClosestByAttribute(e, "data-type", "NodeBlockQueryEmbed")) {
avBackground = avBackground + 'var(--b3-theme-surface)'
}
e.firstElementChild.outerHTML = `<div class="av__container" style="${avBackground}">
<div class="av__header">
<div class="fn__flex av__views${isSearching || query ? " av__views--show" : ""}">
<div class="layout-tab-bar fn__flex">