thinnakrit / editorjs-googlemap

Editor.js Google map inline tools
6 stars 0 forks source link

Uncaught TypeError: this._applyIFrame is not a function #2

Open dgastudio opened 3 years ago

dgastudio commented 3 years ago

Hello,

editorjs: 2.22.1

error 🔊 2021-07-11 19-24-53

thinnakrit commented 3 years ago

Use "window" for check client render only

render (
<div>
{window && <Editor>....</Editor>}
</div>
)
sadmitd commented 2 years ago
render() {

                var _this = this        // Add var

        this.wrapper = document.createElement('div')
        if (this.data && this.data.place) {
            const iframe = document.createElement('iframe')
            this.place = this.data.place
            iframe.height = '500'
            iframe.src = `https://maps.google.com/maps?q=${this.data.place}&t=&z=13&ie=UTF8&iwloc=&output=embed`
            iframe.style ='width: 100%;border-radius: 10px;border: 1px solid #cccccc;'
            this.wrapper.appendChild(iframe)
        } else {
            const input = document.createElement('input')
            const button = document.createElement('button')
            this.wrapper.classList.add('google-map-input')
            this.wrapper.appendChild(input)
            this.wrapper.appendChild(button)
            button.innerHTML = this.config.searchValue || ''
            input.placeholder = this.config.placeholder || ''
            input.value = this.data && this.data.place ? this.data.place : ''
            button.addEventListener('click', function (event){

                                 // Change this to _this

                _this._applyIFrame(input.value)
                _this.wrapper.removeChild(input)
                _this.wrapper.removeChild(button)
            })
        }
        return this.wrapper
    }
scenaristeur commented 2 years ago

Hi, i have same issue with vuejs2 but there is no render . my editorjs code is here https://github.com/scenaristeur/noosphere/blob/main/src/views/EditorView.vue Where/How should i put this wrapper code ?

image

sadmitd commented 2 years ago

I forked, made changes to the src/index.js file and built the project