Skip to content

Commit 5cc8b9d

Browse files
committed
Refactor UIElement constructor to initialize options and update getRole method
1 parent d1faa5b commit 5cc8b9d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core/ui/element.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export abstract class UIElement<T extends IViewBased = IViewBased>
3434
container: HTMLElement;
3535
name: string = '';
3636

37+
protected options?: IDictionary;
38+
3739
getRole(): string {
3840
return this.options?.role || '';
3941
}
@@ -183,11 +185,9 @@ export abstract class UIElement<T extends IViewBased = IViewBased>
183185
);
184186
}
185187

186-
constructor(
187-
jodit: T,
188-
protected options?: IDictionary
189-
) {
188+
constructor(jodit: T, options?: IDictionary) {
190189
super(jodit);
190+
this.options = options;
191191

192192
this.container = this.createContainer(options);
193193

0 commit comments

Comments
 (0)