1
0
Fork 0
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:
Alan Huang 2012-08-09 15:19:02 -07:00
parent 660119915c
commit bc56a01948

View file

@ -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();