I get the following error message when using wp_editor() inside a widget of mine and adding it using the Page Builder:
Cannot read property ‘canvas’ of undefined
It’s working on the widgets page, but not with Page Builder.
The error comes from the quicktags.js file and triggers everytime I click on the different TinyMCE tabs etc.
My guess is that it has something to do with the widgets being loaded through Ajax. Any ideas on how this can be solved?
I’m very close to finishing my plugin now, so it would suck to get stuck because of this :)
I also think this will help other fellow developers who are making widgets primarily for this Page Builder.
Best regards,
Chris
Hi Chris
Thanks for developing with Page Builder in mind. I’ll ask Greg to look into this as soon as he has a moment.
Brilliant!
Hi Christoffer
I’m afraid I can’t be of all that much help here. I’ve spent the last few months working on a widget framework and the one thing I haven’t been able to get quite right is adding a visual editor (using wp_editor). Black Studio TinyMCE is one thing that gets it right, but I haven’t taken a proper look at what they’re all doing.
In short, I think you might be further than I am with this, but I’ll let you know if I make any progress. I’d also really like to get a visual editor into my widgets.
Hey Grey!
A widget framework sounds exciting!
Too bad the visual editor can’t be implemented in an easier way as I’m having trouble making it work with the Customizer as well. If you find a solution though, your pagebuilder could easily match the premium ones in regards to usability.
I’ll check out the Black Studio plugin for ideas. Thanks for your help once again :)
Hi Christoffer just going to jump here as I know Greg is a bit busy on his side. He let me know that a few weeks back he checked what Marco was doing with Black Studio and that it was actually pretty advanced/creative so at this stage he’s decided to leave the editor side of things.
Please keep an eye on this page here: http://profiles.wordpress.org/gpriday/#content-plugins. Soon there will be a widget bundle that might be worth looking at in terms of the processes it uses.
Thanks for letting me know Andrew.
I’ll be sure to keep an eye on the page you’ve provided. I’m actually making a widget bundle myself atm :)
You will get a link when it’s finished, as I hope it’ll enhance the Page Builder.
Super, sounds great. Do let us know when it’s done! Chat soon. Cheers.