|
|
@ -134,21 +134,6 @@ export function initGlobalCommon() {
|
|
|
|
toggleElem($($(this).data('target')));
|
|
|
|
toggleElem($($(this).data('target')));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// make table <tr> and <td> elements clickable like a link
|
|
|
|
|
|
|
|
$('tr[data-href], td[data-href]').on('click', function (e) {
|
|
|
|
|
|
|
|
const href = $(this).data('href');
|
|
|
|
|
|
|
|
if (e.target.nodeName === 'A') {
|
|
|
|
|
|
|
|
// if a user clicks on <a>, then the <tr> or <td> should not act as a link.
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (e.ctrlKey || e.metaKey) {
|
|
|
|
|
|
|
|
// ctrl+click or meta+click opens a new window in modern browsers
|
|
|
|
|
|
|
|
window.open(href);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
window.location = href;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// prevent multiple form submissions on forms containing .loading-button
|
|
|
|
// prevent multiple form submissions on forms containing .loading-button
|
|
|
|
document.addEventListener('submit', (e) => {
|
|
|
|
document.addEventListener('submit', (e) => {
|
|
|
|
const btn = e.target.querySelector('.loading-button');
|
|
|
|
const btn = e.target.querySelector('.loading-button');
|
|
|
|