forked from rDrama/rDrama
1
0
Fork 0

Revert "make ppl able to select text from popover"

This reverts commit 8cdc4e6ee7.
master
Aevann 2023-06-24 17:47:17 +03:00
parent ab20350059
commit 964b87c85a
1 changed files with 2 additions and 21 deletions

View File

@ -14,13 +14,8 @@ popClickBadgeTemplateDOM.loading = "lazy";
popClickBadgeTemplateDOM.alt = "badge";
document.addEventListener('shown.bs.popover', (e) => {
const popfix = document.getElementById("popover-fix")
if (popfix) document.body.removeChild(popfix);
const popover_old = document.getElementsByClassName("popover")[0];
const popover = document.createElement("DIV");
popover.innerHTML = popover_old.outerHTML;
popover.id = "popover-fix";
let popover = document.getElementsByClassName("popover")
popover = popover[popover.length-1]
const author = JSON.parse(e.target.dataset.popInfo);
@ -57,22 +52,8 @@ document.addEventListener('shown.bs.popover', (e) => {
if (author["original_usernames"]) {
popover.getElementsByClassName('pop-original-usernames')[0].innerHTML = author["original_usernames"]
}
document.body.appendChild(popover);
document.body.removeChild(popover_old);
})
document.addEventListener("click", function(){
const cellText = document.getSelection();
if (cellText.type === 'Range') e.preventDefault();
active = document.activeElement.getAttributeNode("class");
if (!(active && active.nodeValue == "user-name text-decoration-none")){
const popfix = document.getElementById("popover-fix")
if (popfix) document.body.removeChild(popfix);
}
});
function post(url) {
const xhr = createXhrWithFormKey(url);
xhr[0].send(xhr[1]);