mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-31 17:08:22 +01:00
Support data-symbol-name in symbol linking
Summary: See D3226. Test Plan: Browse Diffusion. Click on things. Reviewers: epriestley Reviewed By: epriestley CC: nh, aran, Korvin Maniphest Tasks: T1602 Differential Revision: https://secure.phabricator.com/D3227
This commit is contained in:
parent
660119915c
commit
bc56a01948
1 changed files with 4 additions and 1 deletions
|
@ -25,7 +25,6 @@ JX.behavior('repository-crossreference', function(config) {
|
|||
while (target !== document.body) {
|
||||
if (JX.DOM.isNode(target, 'span') && (target.className in map)) {
|
||||
var symbol = target.textContent || target.innerText;
|
||||
var uri = JX.$U('/diffusion/symbol/' + symbol + '/');
|
||||
var query = {
|
||||
lang : config.lang,
|
||||
projects : config.projects.join(','),
|
||||
|
@ -37,6 +36,10 @@ JX.behavior('repository-crossreference', function(config) {
|
|||
if (target.hasAttribute('data-symbol-context')) {
|
||||
query.context = target.getAttribute('data-symbol-context');
|
||||
}
|
||||
if (target.hasAttribute('data-symbol-name')) {
|
||||
symbol = target.getAttribute('data-symbol-name');
|
||||
}
|
||||
var uri = JX.$U('/diffusion/symbol/' + symbol + '/');
|
||||
uri.addQueryParams(query);
|
||||
window.open(uri);
|
||||
e.kill();
|
||||
|
|
Loading…
Add table
Reference in a new issue