Class: EditAttachments

wp.media.view.MediaFrame. EditAttachments


new EditAttachments()

wp.media.view.MediaFrame.EditAttachments A frame for editing the details of a specific media item. Opens in a modal by default. Requires an attachment model to be passed in the options hash under `model`.
Mixes In:
Source:

Extends

Methods


_createModes()

A frame can be in a mode or multiple modes at one time. For example, the manage media frame can be in the `Bulk Select` or `Edit` mode.
Inherited From:
Source:

_createStates()

Create the frame's states.
Inherited From:
Source:
See:
Fires:
  • wp.media.controller.State#event:ready

activateMode(string)

Activate a mode on the frame.
Parameters:
Name Type Description
string mode Mode ID.
Inherited From:
Source:
Returns:
Returns itself to allow chaining.
Type
this

createStates()

Add the default states to the frame.
Source:

deactivateMode(string)

Deactivate a mode on the frame.
Parameters:
Name Type Description
string mode Mode ID.
Inherited From:
Source:
Returns:
Returns itself to allow chaining.
Type
this

dispose()

Inherited From:
Overrides:
Source:
To Do:
  • The internal comment mentions this might have been a stop-gap before Backbone 0.9.8 came out. Figure out if Backbone core takes care of this in Backbone.View now.
Returns:
Returns itself to allow chaining.
Type
wp.media.View

editImageMode(contentRegion)

Render the EditImage view into the frame's content region.
Parameters:
Name Type Description
contentRegion Object Basic object with a `view` property, which should be set with the proper region view.
Source:

editMetadataMode(contentRegion)

Content region rendering callback for the `edit-metadata` mode.
Parameters:
Name Type Description
contentRegion Object Basic object with a `view` property, which should be set with the proper region view.
Source:

focusNavButton(which)

Set focus to the navigation buttons depending on the browsing direction.
Parameters:
Name Type Description
which string A CSS selector to target the button to focus.
Since:
  • 5.3.0
Source:

isModeActive(string)

Check if a mode is enabled on the frame.
Parameters:
Name Type Description
string mode Mode ID.
Inherited From:
Source:
Returns:
bool

keyEvent()

Respond to the keyboard events: right arrow, left arrow, except when focus is in a textarea or input field.
Source:

nextMediaItem()

Click handler to switch to the next media item.
Source:

previousMediaItem()

Click handler to switch to the previous media item.
Source:

remove()

Inherited From:
Overrides:
Source:
Returns:
Returns itself to allow chaining.
Type
wp.media.View

rerender()

Rerender the view.
Source:

reset()

Reset all states on the frame to their defaults.
Inherited From:
Source:
Returns:
Returns itself to allow chaining.
Type
wp.media.view.Frame

triggerModeEvents()

Map activeMode collection events to the frame.
Inherited From:
Source:

Events


{mode}:deactivate

Frame mode deactivation event.
Inherited From:
Source: