JS API – Commands

The new Commands API (since 2.7.0), provides a simple and convenient way to run something the the editor, create a widget, as well as show a notice or undo changes, using JS commands.

The full list of commands, including custom & 3rd commands, is available via:

$e.commands.getAll();

Modals

Modals may have inner tabs that can be navigate via the route API, the full list is available on JS API – Route page.

Template Library

Open the Template Library to the default tab (Pages, Blocks, etc.)

$e.run( 'library/open' );

Close the Template Library

$e.run( 'library/close' );

Toggle the Template Library

$e.run( 'library/toggle' );

Finder

Open the finder

$e.run( 'finder/open' );

Close the finder

$e.run( 'finder/close' );

Toggle the finder

$e.run( 'finder/toggle' );

Navigator

Open the Navigator

$e.run( 'navigator/open' );

Close the Navigator

$e.run( 'navigator/close' );

Toggle the Navigator

$e.run( 'navigator/toggle' );

Shortcuts List

Open the Shortcuts List

$e.run( 'shortcuts/open' );

Close the Shortcuts List

$e.run( 'shortcuts/close' )

Toggle the Shortcuts List

$e.run( 'shortcuts/toggle' );