mirror of
https://github.com/lantean-code/qbtmud.git
synced 2025-10-23 04:52:22 +00:00
17 lines
407 B
JavaScript
17 lines
407 B
JavaScript
const qbt = {};
|
|
|
|
qbt.triggerFileDownload = (url, fileName) => {
|
|
const anchorElement = document.createElement('a');
|
|
anchorElement.href = url;
|
|
anchorElement.download = fileName ?? '';
|
|
anchorElement.click();
|
|
anchorElement.remove();
|
|
}
|
|
|
|
qbt.getBoundingClientRect = (id) => {
|
|
const element = document.getElementById(id);
|
|
|
|
return element.getBoundingClientRect();
|
|
}
|
|
|
|
window.qbt = qbt; |