Skip to content

Commit

Permalink
fix: add js snippet to open slickgrid links in parent window
Browse files Browse the repository at this point in the history
links were only usable if opening in a new tab; this enables them to be opened in the main window if left-clicked, like the "view" link at the beginning of the row.
  • Loading branch information
alycejenni committed Jan 14, 2025
1 parent b1059d8 commit 76e4793
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ckanext/nhm/theme/assets/scripts/slickgrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ var NHMFormatter = function (row, cell, value, columnDef, dataContext) {

// if we don't want to override the functionality, just return the value for the field
if (value && typeof value === 'string') {
value = value.replace(/(https?:\/\/[^ ]+)/g, '<a href="$1">$1</a>');
value = value.replace(
/(https?:\/\/[^ ]+)/g,
'<a href="$1" onclick="window.top.location=this.href">$1</a>',
);
}
return value;
};

0 comments on commit 76e4793

Please sign in to comment.