rDrama/files/assets/js/popover.js
2021-12-09 15:20:58 -06:00

31 lines
No EOL
1,001 B
JavaScript

function eventasdf(value) {
var content_id = value.getAttributeNode("data-content-id").value;
value.addEventListener("click", function() {
jhkj(content_id)
});
}
function checkIfBussy() {
if (document.getElementById("bussy") != null) {
document.body.removeChild(document.getElementById("bussy"));
}
}
function dfgh(e) {
active = document.activeElement;
if (active.getAttributeNode("class") == null || active.getAttributeNode("class").nodeValue != "user-name") {
checkIfBussy();
}
}
function jhkj(value) {
checkIfBussy();
var popover_shit = document.getElementsByClassName("popover")[0];
var uiop = document.createElement("DIV");
uiop.innerHTML = popover_shit.outerHTML;
uiop.id = "bussy";
document.body.appendChild(uiop);
document.body.removeChild(popover_shit);
}
var usernames = document.querySelectorAll("a.user-name");
usernames.forEach(eventasdf);
document.addEventListener("click", function(e) {
dfgh(e)
});