JS code classes and utilities

Calling JS functions defined in preview iframe

Since version 1.1 Live Composer editing interface divided into two areas: 
  • Admin page used as entrance point to the editing mode and container for all the editing panels. 
  • Preview area – iframe with the page we are currently editing.
This structure is very similar to WP Customizer page organized.

Often you need to call JavaScript function defined inside iframe (preview area) from the builder main page. Use the next code to achieve that:
(all the functions defined in main.js should be called that way from builder js files)