core_block/add_modal

Description:
  • Show an add block modal instead of doing it on a separate page.

Source:
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Show an add block modal instead of doing it on a separate page.

Methods

(inner) buildAddBlockModal() → {Promise}

Description:
  • Method that creates the 'add block' modal.

Source:
Returns:

The modal promise (modal's body will be rendered later).

Type
Promise

(inner) getAddableBlocks(pagehash) → {Promise}

Description:
  • Method that fetches all addable blocks in a given page.

Source:
Parameters:
Name Type Description
pagehash String
Returns:
Type
Promise

(inner) init(addBlockUrl, pagehash)

Description:
  • Set up the actions.

Source:
Parameters:
Name Type Description
addBlockUrl String

The add block URL

pagehash String

(inner) registerListenerEvents(addBlockUrl, pagehash)

Description:
  • Register related event listeners.

Source:
Parameters:
Name Type Description
addBlockUrl String | null

The add block URL

pagehash String

(inner) renderBlocks(addBlockUrl, pagehash, region) → {Promise}

Description:
  • Method that renders the list of available blocks.

Source:
Parameters:
Name Type Description
addBlockUrl String

The add block URL

pagehash String
region String
Returns:
Type
Promise