How to define active widget with js in a customizer

I need to use js to define the identifier of the active (open / editable) widget.

+

Catch the event (trigger) switch the active widget.

Is there a built-in js api for these events?

I need something like this:

 jQuery(document).on('widget-updated', function(event, widget){
 //...
 });
jQuery(document).on('widget-added', function(event, widget){
 //...
 });

Or js object (view) with this data.

Read more here: How to define active widget with js in a customizer

Leave a Reply

Your email address will not be published. Required fields are marked *