mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-30 09:18:18 +00:00
Make it so that tapping an image that’s a link navigates to the link. (Doesn’t zoom the image.)
This commit is contained in:
1 parent
d212c42ad5
commit
74eea8fe86
1 file changed
+6
-3
@@ -96,9 +96,12 @@ class ImageViewer {
|
||||
// Add the click listener for images
|
||||
window.onclick = function(event) {
|
||||
if (event.target.matches("img") && !event.target.classList.contains("nnw-nozoom")) {
|
||||
// Without this, tapping an image wrapped in a link also navigates.
|
||||
// <https://github.com/Ranchero-Software/NetNewsWire/issues/5275>
|
||||
event.preventDefault();
|
||||
// An image inside a link navigates — it might be the only link to an
|
||||
// important page. Zoom only standalone images.
|
||||
// <https://github.com/Ranchero-Software/NetNewsWire/issues/3641>
|
||||
if (event.target.closest("a[href]")) {
|
||||
return;
|
||||
}
|
||||
if (activeImageViewer && activeImageViewer.img === event.target) {
|
||||
cancelImageLoad();
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user