neutral/public/javascripts/basics.js

36 lines
703 B
JavaScript

// Get Document ID
function getID(string) {
return document.getElementById(string)
}
class InfoPop {
constructor(name) {
this.name = name
this.element = getID(this.name)
this.element.innerHTML = " "
this.element.style.fontSize = "14px"
this.element.style.position = "sticky"
}
clear() {
this.element.innerHTML = "&nbsp"
}
err(text) {
this.element.classList.add("yellow")
this.element.innerHTML = "<i class='fa fa-warning'></i> " + text
}
info(text) {
this.element.classList.remove("yellow")
this.element.innerHTML = "<i class='fa fa-info-circle'></i> " + text
}
}