@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make symbol linking more lenient.

Summary:
Sometimes a symbol has a nested <span> in it. Clicks on that
should count as clicks on the symbol. So keep looking for symbols among
the ancestors of the click target.

This is a silly method because I don't know if there's a more idiomatic
way to do it in Javelin.

Test Plan:
Open a Differential revision where part of a symbol is
highlighted. Click on the highlighted part. Symbol search opens.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Maniphest Tasks: T1577

Differential Revision: https://secure.phabricator.com/D3113

+15 -11
+15 -11
webroot/rsrc/js/application/repository/repository-crossreference.js
··· 19 19 function(e) { 20 20 var target = e.getTarget(); 21 21 var map = {nc : 'class', nf : 'function'}; 22 - if (JX.DOM.isNode(target, 'span') && (target.className in map)) { 23 - var symbol = target.textContent || target.innerText; 24 - var uri = JX.$U('/diffusion/symbol/' + symbol + '/'); 25 - uri.addQueryParams({ 26 - type : map[target.className], 27 - lang : config.lang, 28 - projects : config.projects.join(','), 29 - jump : true 30 - }); 31 - window.open(uri); 32 - e.kill(); 22 + while (target !== document.body) { 23 + if (JX.DOM.isNode(target, 'span') && (target.className in map)) { 24 + var symbol = target.textContent || target.innerText; 25 + var uri = JX.$U('/diffusion/symbol/' + symbol + '/'); 26 + uri.addQueryParams({ 27 + type : map[target.className], 28 + lang : config.lang, 29 + projects : config.projects.join(','), 30 + jump : true 31 + }); 32 + window.open(uri); 33 + e.kill(); 34 + break; 35 + } 36 + target = target.parentNode; 33 37 } 34 38 }); 35 39