mirror of
https://github.com/outline/outline.git
synced 2025-04-13 01:29:39 +00:00
chore: Move document embed switching to toggle
This commit is contained in:
@ -14,7 +14,6 @@ import {
|
||||
ImportIcon,
|
||||
NewDocumentIcon,
|
||||
DownloadIcon,
|
||||
BuildingBlocksIcon,
|
||||
RestoreIcon,
|
||||
CrossIcon,
|
||||
} from "outline-icons";
|
||||
@ -410,20 +409,6 @@ function DocumentMenu({
|
||||
visible: can.permanentDelete,
|
||||
icon: <CrossIcon />,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
title: t("Enable embeds"),
|
||||
onClick: document.enableEmbeds,
|
||||
visible: !!showToggleEmbeds && document.embedsDisabled,
|
||||
icon: <BuildingBlocksIcon />,
|
||||
},
|
||||
{
|
||||
type: "button",
|
||||
title: t("Disable embeds"),
|
||||
onClick: document.disableEmbeds,
|
||||
visible: !!showToggleEmbeds && !document.embedsDisabled,
|
||||
icon: <BuildingBlocksIcon />,
|
||||
},
|
||||
{
|
||||
type: "separator",
|
||||
},
|
||||
@ -452,21 +437,38 @@ function DocumentMenu({
|
||||
},
|
||||
]}
|
||||
/>
|
||||
{showDisplayOptions && !isMobile && (
|
||||
{(showDisplayOptions || showToggleEmbeds) && (
|
||||
<>
|
||||
<Separator />
|
||||
<Style>
|
||||
<ToggleMenuItem
|
||||
width={26}
|
||||
height={14}
|
||||
label={t("Full width")}
|
||||
checked={document.fullWidth}
|
||||
onChange={(ev) => {
|
||||
document.fullWidth = ev.currentTarget.checked;
|
||||
document.save();
|
||||
}}
|
||||
/>
|
||||
</Style>
|
||||
{showToggleEmbeds && (
|
||||
<Style>
|
||||
<ToggleMenuItem
|
||||
width={26}
|
||||
height={14}
|
||||
label={t("Enable embeds")}
|
||||
checked={!document.embedsDisabled}
|
||||
onChange={
|
||||
document.embedsDisabled
|
||||
? document.enableEmbeds
|
||||
: document.disableEmbeds
|
||||
}
|
||||
/>
|
||||
</Style>
|
||||
)}
|
||||
{showDisplayOptions && !isMobile && (
|
||||
<Style>
|
||||
<ToggleMenuItem
|
||||
width={26}
|
||||
height={14}
|
||||
label={t("Full width")}
|
||||
checked={document.fullWidth}
|
||||
onChange={(ev) => {
|
||||
document.fullWidth = ev.currentTarget.checked;
|
||||
document.save();
|
||||
}}
|
||||
/>
|
||||
</Style>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</ContextMenu>
|
||||
|
Reference in New Issue
Block a user