Use globalThis instead of window (S7764)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -409,7 +409,7 @@ function handleClick(tagId) {
|
||||
isActive.value = tagId;
|
||||
|
||||
if (isSafeTagId(tagId)) {
|
||||
window.location.href = tagId;
|
||||
globalThis.location.href = tagId;
|
||||
} else {
|
||||
console.warn("Unsafe tagId: ", tagId);
|
||||
}
|
||||
|
||||
@@ -392,7 +392,7 @@ function handleClick(tagId) {
|
||||
isActive.value = tagId;
|
||||
|
||||
if (isSafeTagId(tagId)) {
|
||||
window.location.href = tagId;
|
||||
globalThis.location.href = tagId;
|
||||
} else {
|
||||
console.warn("Unsafe tagId: ", tagId);
|
||||
}
|
||||
|
||||
@@ -928,7 +928,7 @@ const handleWindowClick = (e) => {
|
||||
onMounted(async () => {
|
||||
isLoading.value = true;
|
||||
await store.fetchAllFiles();
|
||||
window.addEventListener("click", handleWindowClick);
|
||||
globalThis.addEventListener("click", handleWindowClick);
|
||||
// Add the .scrollbar class to the DataTable tbody
|
||||
const tbodyElement = document.querySelector(".p-datatable-tbody");
|
||||
tbodyElement?.classList.add("scrollbar");
|
||||
@@ -936,7 +936,7 @@ onMounted(async () => {
|
||||
});
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener("click", handleWindowClick);
|
||||
globalThis.removeEventListener("click", handleWindowClick);
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
@@ -329,7 +329,7 @@ function getTextWidth(text, e) {
|
||||
const hiddenSpan = document.createElement("span");
|
||||
|
||||
hiddenSpan.textContent = processedText;
|
||||
hiddenSpan.style.font = window.getComputedStyle(e).font;
|
||||
hiddenSpan.style.font = globalThis.getComputedStyle(e).font;
|
||||
hiddenSpan.style.visibility = "hidden";
|
||||
document.body.appendChild(hiddenSpan);
|
||||
const width = hiddenSpan.getBoundingClientRect().width;
|
||||
|
||||
Reference in New Issue
Block a user