UNPKG

getaddress-autocomplete-modal

Version:

GetAddress.io - Autocomplete modal plug-in

28 lines 1.12 kB
import { Debug } from "./Debug.js"; export default class BackButton { constructor(modal, input, attributeValues) { this.modal = modal; this.input = input; this.attributeValues = attributeValues; this.button = document.createElement('BUTTON'); this.element = this.button; this.build = () => { const icon = document.createElement('i'); icon.className = this.attributeValues.iconBackClassName; icon.classList.add(this.attributeValues.iconClassName); this.button.insertAdjacentElement('afterbegin', icon); this.button.className = this.attributeValues.backButtonClassName; this.button.classList.add(this.attributeValues.buttonClassName); this.button.addEventListener('click', this.handleClick); }; this.handleClick = (e) => { Debug.Log(this.attributeValues, e); this.modal.close(); }; this.build(); } destroy() { this.button.removeEventListener('click', this.handleClick); } } //# sourceMappingURL=BackButton.js.map