Skip to content

Commit

Permalink
fix: Allow "Convert to Link" option on images
Browse files Browse the repository at this point in the history
  • Loading branch information
surajshetty3416 committed Mar 26, 2024
1 parent c4c713f commit fd0c30e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions frontend/src/components/BlockContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import blockController from "@/utils/blockController";
import getBlockTemplate from "@/utils/blockTemplate";
import { confirm, detachBlockFromComponent, getBlockCopy } from "@/utils/helpers";
import { vOnClickOutside } from "@vueuse/components";
import { Dialog } from "frappe-ui";
import { nextTick, ref } from "vue";
import { toast } from "vue-sonner";
import ContextMenu from "./ContextMenu.vue";
Expand Down Expand Up @@ -136,7 +135,7 @@ const contextMenuOptions: ContextMenuOption[] = [
label: "Convert To Link",
action: () => {
blockController.getSelectedBlocks().forEach((block: Block) => {
if (block.isSVG()) {
if (block.isSVG() || block.isImage()) {
const parentBlock = block.getParentBlock();
if (!parentBlock) return;
const newBlockObj = getBlockTemplate("fit-container");
Expand All @@ -153,7 +152,7 @@ const contextMenuOptions: ContextMenuOption[] = [
});
},
condition: () =>
(props.block.isContainer() || props.block.isText()) &&
(props.block.isContainer() || props.block.isText() || props.block.isImage()) &&
!props.block.isLink() &&
!props.block.isExtendedFromComponent() &&
!props.block.isRoot(),
Expand Down

0 comments on commit fd0c30e

Please sign in to comment.