UNPKG

sparnatural

Version:

Visual client-side SPARQL query builder and knowledge graph exploration tool

28 lines (24 loc) 666 B
import { getSettings } from "../../../sparnatural/settings/defaultSettings"; import HTMLComponent from "../HtmlComponent"; class AddUserInputBtn extends HTMLComponent { callBack: () => void; constructor( parentComponent: HTMLComponent, btnText: string, callBack: () => void ) { let widgetHtml = $(`<button class="button-add"> ${btnText} </button>`); super("AddUserInputBtn", parentComponent, widgetHtml); this.callBack = callBack; } render(): this { super.render(); this.widgetHtml[0].addEventListener("click", () => { this.callBack(); }); return this; } } export default AddUserInputBtn;