sparnatural
Version:
Visual client-side SPARQL query builder and knowledge graph exploration tool
34 lines • 1.25 kB
JavaScript
import { getSettings } from "../../../sparnatural/settings/defaultSettings";
import { PlayBtn } from "../buttons/PlayBtn";
import { HTMLComponent } from "../HtmlComponent";
import { SparnaturalElement } from "../../../SparnaturalElement";
class SubmitSection extends HTMLComponent {
constructor(ParentComponent) {
super("submitSection", ParentComponent, null);
// Make arrow function to bind the this lexically
// see: https://stackoverflow.com/questions/55088050/ts-class-method-is-undefined-in-callback
this.submitAction = () => {
if (getSettings().submitButton) {
let e = new CustomEvent(SparnaturalElement.EVENT_SUBMIT, {
bubbles: true,
detail: this.ParentSparnatural,
});
this.html[0].dispatchEvent(e);
}
};
this.ParentSparnatural = ParentComponent;
}
render() {
super.render();
this.playBtn = new PlayBtn(this, this.submitAction).render();
return this;
}
enableSubmit() {
this.playBtn.enable();
}
disableSubmit() {
this.playBtn.disable();
}
}
export default SubmitSection;
//# sourceMappingURL=SubmitSection.js.map