Skip to content

Commit

Permalink
fix: disable viewer for avatar in linklist
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcticLampyrid committed Sep 10, 2024
1 parent 489774b commit bf249fc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/js/kr-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,17 @@ import scrollIntoView from "scroll-into-view-if-needed";
if (kr.enable) {
const postEntry = document.getElementsByClassName("kratos-page-content");
if (postEntry.length > 0) {
new Viewer(postEntry[0]);
new Viewer(postEntry[0], {
filter: (image) => {
// ignore <img> inside `.kr-linklist`
if (typeof image.closest === "function") {
if (image.closest(".kr-linklist") !== null) {
return false;
}
}
return true;
},
});
}
}
};
Expand Down

0 comments on commit bf249fc

Please sign in to comment.