@ribajs/core
Version:
Core module of Riba.js
15 lines (13 loc) • 316 B
text/typescript
import { Binder } from "../binder.js";
/**
* Enables the element when value is true.
*/
export class EnabledBinder extends Binder<
boolean,
HTMLButtonElement | HTMLInputElement
> {
static key = "enabled";
routine(el: HTMLButtonElement | HTMLInputElement, value: boolean) {
el.disabled = !value;
}
}