Class: Region

wp.media.controller. Region


new Region(options)

wp.media.controller.Region A region is a persistent application layout area. A region assumes one mode at any time, and can be switched to another. When mode changes, events are triggered on the region's parent view. The parent view will listen to specific events and fill the region with an appropriate view depending on mode. For example, a frame listens for the 'browse' mode t be activated on the 'content' view and then fills the region with an AttachmentsBrowser view.
Parameters:
Name Type Description
options object Options hash for the region.
Properties
Name Type Description
id string Unique identifier for the region.
view Backbone.View A parent view the region exists within.
selector string jQuery selector for the region within the parent view.
Source:

Methods


get()

Get the region's view.
Since:
  • 3.5.0
Source:
Returns:
Type
wp.media.View

mode(mode)

Activate a mode.
Parameters:
Name Type Description
mode string
Since:
  • 3.5.0
Source:
Fires:
  • Region#event:activate
  • Region#event:deactivate
Returns:
Returns itself to allow chaining.
Type
wp.media.controller.Region

render(mode)

Render a mode.
Parameters:
Name Type Description
mode string
Since:
  • 3.5.0
Source:
Fires:
  • Region#event:create
  • Region#event:render
Returns:
Returns itself to allow chaining.
Type
wp.media.controller.Region

set(views [, options])

Set the region's view as a subview of the frame.
Parameters:
Name Type Argument Default Description
views Array | Object
options Object <optional>
{}
Since:
  • 3.5.0
Source:
Returns:
Subviews is returned to allow chaining.
Type
wp.Backbone.Subviews

trigger(event)

Trigger regional view events on the frame.
Parameters:
Name Type Description
event string
Since:
  • 3.5.0
Source:
Returns:
Returns itself to allow chaining.
Type
undefined | wp.media.controller.Region

Events


activate

Region mode activation event.
Source:

create

Create region view event. Region view creation takes place in an event callback on the frame.
Type: object
Properties:
Name Type Description
view object
Source:

deactivate

Region mode deactivation event.
Source:

render

Render region view event. Region view creation takes place in an event callback on the frame.
Type: object
Source: