Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

690 B
Raw Blame
import {isMobile} from "../../util/functions";

export const updateBackgroundActions = (protyle: IProtyle) => {
    const element = protyle.background?.element;
    if (!element) {
        return;
    }
    const isDatabaseRow = Boolean(protyle.element.dataset.databaseRowId && protyle.block.showAll &&
        protyle.element.dataset.databaseRowId === protyle.block.id);
    const isDocument = protyle.block.id === protyle.block.rootID;
    element.classList.toggle("protyle-background--hide-actions", isDatabaseRow && !isDocument);
    if (isMobile()) {
        element.classList.toggle("protyle-background--mobileshow", !protyle.block.showAll || (isDatabaseRow && isDocument));
    }
};