Skip to content

Commit

Permalink
Revert "Added conditions to check if image exists before adding event…
Browse files Browse the repository at this point in the history
… listeners (#957)" (#958)

This reverts commit 374d1f4.
  • Loading branch information
gaagul authored Dec 7, 2023
1 parent 374d1f4 commit 93de5c0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/components/EditorContent/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { useEffect, useRef, useState } from "react";
import classnames from "classnames";
import DOMPurify from "dompurify";
import CopyToClipboardButton from "neetomolecules/CopyToClipboardButton";
import { isNil, not } from "ramda";
import { not } from "ramda";
import { createRoot } from "react-dom/client";

import { EDITOR_CONTENT_CLASSNAME, SANITIZE_OPTIONS } from "./constants";
Expand Down Expand Up @@ -45,9 +45,10 @@ const EditorContent = ({
figureTags.forEach(figureTag => {
const image = figureTag.querySelector("img");
const link = figureTag.querySelector("a");
if (isNil(image) || isNil(link)) return;

if (not(window.getComputedStyle(link).pointerEvents === "none")) {
if (
!image ||
not(window.getComputedStyle(link).pointerEvents === "none")
) {
return;
}
figureTag.style.cursor = "pointer";
Expand Down

0 comments on commit 93de5c0

Please sign in to comment.