Page MenuHomePhabricator

<maplink> event listener is not attached to elements outside of content
Closed, ResolvedPublic

Description

This code in Kartographer ignores the <maplink> link that (by some magic?) gets placed outside of the page content. See example (I suspect some site customization automatically moves the {{User:Yurik/Sandbox/geo|47.8000|13.0500}} to the very top).

mw.hook( 'wikipage.content' ).add( function ( $content ) {
  ...
  $content.on( 'click', '.mw-kartographer-link', function () {

Event Timeline

@JGirault is it possible to replace $content.on(...) with $.on(...) ?

Change 294647 had a related patch set uploaded (by JGirault):
Search for maplinks inside and outside of content.

https://gerrit.wikimedia.org/r/294647

Change 294647 merged by jenkins-bot:
Search for maplinks inside and outside of content.

https://gerrit.wikimedia.org/r/294647

Change 294648 had a related patch set uploaded (by Yurik):
Search for maplinks inside and outside of content.

https://gerrit.wikimedia.org/r/294648

Change 294648 merged by jenkins-bot:
Search for maplinks inside and outside of content.

https://gerrit.wikimedia.org/r/294648

Yurik claimed this task.