This commit is contained in:
Blue 2018-11-19 17:45:42 +03:00
parent b342e33912
commit abfeb77fa5

View File

@ -1,7 +1,7 @@
class Button { class Button {
constructor(image) { constructor(image) {
this.element = document.createElement("button"); this.element = document.createElement("button");
this.element.add("shadow"); this.element.classList.add("shadow");
this.element.style.backgroundImage = "url(images/" + image + ".svg)"; this.element.style.backgroundImage = "url(images/" + image + ".svg)";
this._boundClick = this._onClick.bind(this); this._boundClick = this._onClick.bind(this);
this.element.addEventListener("click", this._boundClick, false); this.element.addEventListener("click", this._boundClick, false);