+ constructor(o) {
+ super(o);
+ if (!o.genFenOnly && !o.diagram) {
+
+ this.passListener = () => this.play({pass: true}); //TODO: wrong, need to use buildMoveStack (warning empty move...)
+
+ // Show pass btn
+ let passBtn = document.createElement("button");
+ C.AddClass_es(passBtn, "pass-btn");
+ passBtn.innerHTML = "pass";
+ passBtn.addEventListener("click", this.passListener);
+ let container = document.getElementById(this.containerId);
+ container.appendChild(passBtn);
+ }
+ }
+
+ removeListeners() {
+ super.removeListeners();
+ let passBtn = document.getElementsByClassName("pass-btn")[0];
+ passBtn.removeEventListener("click", this.passListener);
+ }
+