mirror of
https://github.com/Krafpy/KSP-MGA-Planner.git
synced 2026-01-10 04:06:24 -08:00
Also refactored `button.ts` to use a common `Button` class instead of separate `SubmitButton` and `StopButton` types.
15 lines
277 B
JavaScript
15 lines
277 B
JavaScript
export class Button {
|
|
constructor(id) {
|
|
this._btn = document.getElementById(id);
|
|
}
|
|
enable() {
|
|
this._btn.disabled = false;
|
|
}
|
|
disable() {
|
|
this._btn.disabled = true;
|
|
}
|
|
click(action) {
|
|
this._btn.onclick = action;
|
|
}
|
|
}
|