@teachingtextbooks/keyboard
Version:
Customizable TypeScript soft keyboard
17 lines (16 loc) • 719 B
JavaScript
import KeyBtnAbstr from "./key-btn-abstr";
import { KeyboardCSS } from "./const";
export default class KeyBtnBase extends KeyBtnAbstr {
constructor(win, doc, config, holder, callback) {
super(win, doc, config, 0, 0, holder, false, false, callback);
// this.txt = doc.createTextNode(this.config.label || this.config.key || '');
this.label = doc.createElement('label');
this.label.classList.add(KeyboardCSS.LABEL);
this.label.setAttribute("title", this.config.label || this.config.key || '');
// this.label.appendChild(this.txt);
this.span.appendChild(this.label);
}
getClasses() {
return [KeyboardCSS.BUTTON, KeyboardCSS.UNSELECTABLE];
}
}