mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-15 03:44:31 +08:00
add metadata, getElement method
This commit is contained in:
parent
872250a769
commit
4521dc7301
1 changed files with 8 additions and 1 deletions
|
|
@ -41,13 +41,20 @@ export class Caret {
|
|||
private marginTopAnimation: JSAnimation | null = null;
|
||||
private marginLeftAnimation: JSAnimation | null = null;
|
||||
|
||||
constructor(element: ElementWithUtils, style: CaretStyle) {
|
||||
metadata: Record<string, string> = {};
|
||||
|
||||
constructor(element: ElementWithUtils, style: CaretStyle, metadata = {}) {
|
||||
this.id = element.native.id;
|
||||
this.element = element;
|
||||
this.setStyle(style);
|
||||
if (this.id === "caret") {
|
||||
this.isMainCaret = true;
|
||||
}
|
||||
this.metadata = metadata;
|
||||
}
|
||||
|
||||
public getElement(): ElementWithUtils {
|
||||
return this.element;
|
||||
}
|
||||
|
||||
public setStyle(style: CaretStyle): void {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue