1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

#6372: Implement table-flush styling, improve changelog layout

This commit is contained in:
checktheroads
2021-07-13 09:14:57 -07:00
parent 6b88ed0321
commit bfb1b6ac0a
12 changed files with 100 additions and 48 deletions

View File

@ -0,0 +1,15 @@
import { isTruthy, getElements } from './util';
/**
* Allow any element to be made "clickable" with the use of the `data-href` attribute.
*/
export function initLinks() {
for (const link of getElements('*[data-href]')) {
const href = link.getAttribute('data-href');
if (isTruthy(href)) {
link.addEventListener('click', () => {
window.location.assign(href);
});
}
}
}