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. 
    /wp-admin/admin.php?page=livecomposer_editor&page_id=XX
  • 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:
DSLC.Editor.frameContext.funciton_name();
(all the functions defined in main.js should be called that way from builder js files)

Still need help? Contact Us Contact Us