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
|
- 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. -
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. -
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
- Source:
Properties:
Name Type Description view
object -
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: