Formatting, remove old, unused code

This commit is contained in:
pietervdvn 2021-06-23 02:14:15 +02:00
parent a365172e0c
commit 89df28ae06

View file

@ -8,16 +8,12 @@ import {UIEventSource} from "../Logic/UIEventSource";
*/
export default abstract class BaseUIElement {
protected _constructedHtmlElement: HTMLElement;
private clss: Set<string> = new Set<string>();
private style: string;
private _onClick: () => void;
private _onHover: UIEventSource<boolean>;
protected _constructedHtmlElement: HTMLElement;
protected abstract InnerConstructElement(): HTMLElement;
public onClick(f: (() => void)) {
this._onClick = f;
this.SetClass("clickable")
@ -44,6 +40,7 @@ export default abstract class BaseUIElement {
return this;
}
/**
* Adds all the relevant classes, space seperated
*/
@ -151,7 +148,8 @@ try{
el.addEventListener('mouseout', () => self._onHover.setData(false));
}
return el}catch(e){
return el
} catch (e) {
const domExc = e as DOMException;
if (domExc) {
console.log("An exception occured", domExc.code, domExc.message, domExc.name)
@ -163,4 +161,6 @@ try{
public AsMarkdown(): string {
throw "AsMarkdown is not implemented by " + this.constructor.name
}
protected abstract InnerConstructElement(): HTMLElement;
}