sparnatural
Version:
Visual client-side SPARQL query builder and knowledge graph exploration tool
20 lines (17 loc) • 518 B
text/typescript
import HTMLComponent from "../HtmlComponent";
import UiuxConfig from "../IconsConstants";
class EditBtn extends HTMLComponent {
constructor(ParentComponent: HTMLComponent, callBack: () => void) {
let widgetHtml = $(`<span>${UiuxConfig.ICON_PEN}</span>`);
super("edit", ParentComponent, widgetHtml);
// add clicklistener
this.widgetHtml.on("click", function (e: JQuery.ClickEvent) {
callBack();
});
}
render(): this {
super.render();
return this;
}
}
export default EditBtn;