Niedzielski has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/396091 )
Change subject: Fix: image links don't load destination in place
......................................................................
Fix: image links don't load destination in place
Check the parent of clicked images to see if they're an anchor. If so,
render on the client. This change fixes the lead images but may be found
to fail for other scenarios. However, it's consistent with the
preexisting implementation of checking event.target. If this change
proves inadequate, event.target should be ascended until an anchor is
found.
Bug: T181901
Change-Id: Ia2a50555675c93cb3784d271f8f9bcd7ccff4c80
---
M src/common/components/link/on-click.ts
1 file changed, 7 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/91/396091/1
diff --git a/src/common/components/link/on-click.ts
b/src/common/components/link/on-click.ts
index 21f827b..461a97e 100644
--- a/src/common/components/link/on-click.ts
+++ b/src/common/components/link/on-click.ts
@@ -25,6 +25,13 @@
// something else. Use target if it is a link, as the handler triggers on
// the bubbling phase
link = event.target;
+ } else if (
+ event.target instanceof Node &&
+ event.target.parentElement instanceof HTMLAnchorElement
+ ) {
+ // When set on a parent, the target may be an image. Check the parent to
+ // see if it's an anchor.
+ link = event.target.parentElement;
}
if (
--
To view, visit https://gerrit.wikimedia.org/r/396091
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia2a50555675c93cb3784d271f8f9bcd7ccff4c80
Gerrit-PatchSet: 1
Gerrit-Project: marvin
Gerrit-Branch: master
Gerrit-Owner: Niedzielski <[email protected]>
Gerrit-Reviewer: Sniedzielski <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits