Skip to content

Commit

Permalink
Add support for multiple polity links in legend for improved navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardchalstrey1 committed Jan 10, 2025
1 parent 895d613 commit a5fda5a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions seshat/apps/core/static/core/js/map_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,17 @@ function updateLegend() {
if (shape.seshat_id in seshat_id_page_id) {
var polityId = seshat_id_page_id[shape.seshat_id]['id'];
shape_name_col_dict['link'] = '<a href="/core/polity/' + polityId + '" target="_blank">' + shape.name + '</a>';
} else if (shape.seshat_id.includes(';')) {
var polityIds = shape.seshat_id.split(';');
var polityLinks = [];
polityIds.forEach(function (polityId) {
if (polityId in seshat_id_page_id) {
polityLinks.push('<a href="/core/polity/' + seshat_id_page_id
[polityId]['id'] + '" target="_blank">' + polityId + '</a>');
}
}
);
shape_name_col_dict['link'] = shape.name + '; ' + polityLinks.join('; ');
} else {
shape_name_col_dict['link'] = shape.name;
}
Expand Down

0 comments on commit a5fda5a

Please sign in to comment.