Initial
This commit is contained in:
8
app/base/static/js/onload.js
Executable file
8
app/base/static/js/onload.js
Executable file
@@ -0,0 +1,8 @@
|
||||
document.querySelectorAll('.table[data-onclick]').forEach((tbl) => {
|
||||
tbl.classList.add('clickable');
|
||||
const callback = new Function(tbl.dataset.onclick);
|
||||
tbl.onclick = (event) => {
|
||||
const entry = event.target.closest('tbody>tr');
|
||||
if (entry) { callback.call(tbl, row=entry); }
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user