const removeChildren = (element) => {
if (!element) {
return
}
while (element.firstChild) {
element.removeChild(element.firstChild)
}
}
AFRAME.registerComponent('customize-buttons-in-capture-preview', {
init() {
console.log('customizeButtonsInCapturePreviewComponent.init')
this.downloadButton = document.querySelector('#downloadButton')
this.actionButton = document.querySelector('#actionButton')
removeChildren(this.downloadButton)
removeChildren(this.actionButton)
this.downloadButton.classList.remove('icon-button')
this.downloadButton.classList.add('capture-preview-button')
this.actionButton.classList.add('capture-preview-button')
this.downloadButton.innerHTML = `
Сохранить`
this.actionButton.innerHTML = `
Поделиться`
},
})