Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ui/src/components/ai-chat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -717,11 +717,11 @@ onMounted(() => {
if (event.target) {
const target = event.target as HTMLElement
// 假设打开状态的图片具有特定类名
if (target.className && target.className.includes('medium-zoom-overlay')) {
if (target.classList && target.classList.contains('medium-zoom-overlay')) {
event.preventDefault()
event.stopPropagation()
}
if (target.className && target.className.includes('medium-zoom-image--opened')) {
if (target.classList && target.classList.contains('medium-zoom-image--opened')) {
event.preventDefault()
event.stopPropagation()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proposed changes to the code are valid and do not introduce any bugs. However:

  1. Using classList is more modern and idiomatic than checking with className, which can be deprecated in future versions of JavaScript.

However, if you want to maintain backward compatibility (which isn't strictly necessary given this is new functionality), both styles work fine here.

To answer your main question directly from the provided context: No irregularities or issues were identified but there's an update to use .classList instead of .className.

Expand Down
Loading