mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-06 23:21:16 +08:00
Merge pull request #978 from nagisa77/codex/fix-image-preview-trigger-in-markdown
fix: restrict image preview to markdown images
This commit is contained in:
@@ -342,7 +342,7 @@ const copyCommentLink = () => {
|
||||
|
||||
const handleContentClick = (e) => {
|
||||
handleMarkdownClick(e)
|
||||
if (e.target.tagName === 'IMG') {
|
||||
if (e.target.tagName === 'IMG' && !e.target.classList.contains('emoji')) {
|
||||
const container = e.target.parentNode
|
||||
const imgs = [...container.querySelectorAll('img')].map((i) => i.src)
|
||||
lightboxImgs.value = imgs
|
||||
|
||||
@@ -463,7 +463,11 @@ function minimize() {
|
||||
|
||||
function handleContentClick(e) {
|
||||
handleMarkdownClick(e)
|
||||
if (e.target.tagName === 'IMG') {
|
||||
if (
|
||||
e.target.tagName === 'IMG' &&
|
||||
!e.target.classList.contains('emoji') &&
|
||||
!e.target.closest('.reactions-container')
|
||||
) {
|
||||
const container = e.target.parentNode
|
||||
const imgs = [...container.querySelectorAll('img')].map((i) => i.src)
|
||||
lightboxImgs.value = imgs
|
||||
|
||||
@@ -434,7 +434,7 @@ const removeCommentFromList = (id, list) => {
|
||||
|
||||
const handleContentClick = (e) => {
|
||||
handleMarkdownClick(e)
|
||||
if (e.target.tagName === 'IMG') {
|
||||
if (e.target.tagName === 'IMG' && !e.target.classList.contains('emoji')) {
|
||||
const container = e.target.parentNode
|
||||
const imgs = [...container.querySelectorAll('img')].map((i) => i.src)
|
||||
lightboxImgs.value = imgs
|
||||
|
||||
Reference in New Issue
Block a user