new Cropper()
wp.media.controller.Cropper
A class for cropping an image when called from the header media customization panel.
- Source:
Extends
- wp.media.controller.State
- Backbone.Model
Methods
-
<private> [undefined]()
-
- Inherited From:
- Source:
-
<private> _deactivate()
-
- Since:
-
- 3.5.0
- Inherited From:
- Source:
-
<private> _menu()
-
- Since:
-
- 3.5.0
- Inherited From:
- Source:
-
<private> _postActivate()
-
- Since:
-
- 3.5.0
- Inherited From:
- Source:
-
<private> _preActivate()
-
- Since:
-
- 3.5.0
- Inherited From:
- Source:
-
<private> _ready()
-
- Since:
-
- 3.5.0
- Inherited From:
- Source:
-
<private> _renderMenu(view)
-
Create a view in the media menu for the state.
Parameters:
Name Type Description view
media.view.Menu The menu view. - Since:
-
- 3.5.0
- Inherited From:
- Source:
-
<private> _renderTitle()
-
- Since:
-
- 3.5.0
- Inherited From:
- Source:
-
<private> _router()
-
- Since:
-
- 3.5.0
- Inherited From:
- Source:
-
<private> _title()
-
- Since:
-
- 3.5.0
- Inherited From:
- Source:
-
<private> _updateMenu()
-
- Since:
-
- 3.5.0
- Inherited From:
- Source:
-
activate()
-
Shows the crop image window when called from the Add new image button.
- Since:
-
- 4.2.0
- Overrides:
- Source:
Returns:
- Type
- void
-
constructor()
-
Constructor.
- Since:
-
- 3.5.0
- Inherited From:
- Source:
-
createCropContent()
-
Creates the crop image window. Initialized when clicking on the Select and Crop button.
- Since:
-
- 4.2.0
- Source:
Fires:
- event:crop window
Returns:
- Type
- void
-
createCropToolbar()
-
Checks if cropping can be skipped and creates crop toolbar accordingly.
- Since:
-
- 4.2.0
- Source:
Returns:
- Type
- void
-
deactivate()
-
Changes the state of the toolbar window to browse mode.
- Since:
-
- 4.2.0
- Overrides:
- Source:
Returns:
- Type
- void
-
doCrop()
-
Creates an object with the image attachment and crop properties.
- Since:
-
- 4.2.0
- Source:
Returns:
A jQuery promise with the custom header crop details.- Type
- $.promise
-
<abstract> ready()
-
Ready event callback.
- Since:
-
- 3.5.0
- Inherited From:
- Source:
-
removeCropper()
-
Removes the image selection and closes the cropping window.
- Since:
-
- 4.2.0
- Source:
Returns:
- Type
- void
-
<abstract> reset()
-
Reset event callback.
- Since:
-
- 3.5.0
- Inherited From:
- Source: