another attempt to make download
This commit is contained in:
parent
53f84b5d08
commit
9745030288
3 changed files with 17 additions and 13 deletions
13
ui/button.js
13
ui/button.js
|
@ -1,10 +1,19 @@
|
|||
import UI from "./ui.js";
|
||||
|
||||
class Button extends UI {
|
||||
constructor(image) {
|
||||
super(document.createElement("button"), Button.width, Button.height);
|
||||
constructor(image, isRef) {
|
||||
isRef = isRef !== false;
|
||||
let element;
|
||||
if (isRef) {
|
||||
element = document.createElement("a");
|
||||
element.href = "#";
|
||||
} else {
|
||||
element = document.createElement("button");
|
||||
}
|
||||
super(element, Button.width, Button.height);
|
||||
|
||||
this.element.classList.add("shadow");
|
||||
this.element.classList.add("button");
|
||||
this.element.style.backgroundImage = "url(images/" + image + ".svg)";
|
||||
this._boundClick = this._onClick.bind(this);
|
||||
this.element.addEventListener("click", this._boundClick, false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue