Customize: Update `cropper.js` to match changes in [36866].

`media-views.js` was updated, but the changes weren't added to `cropper.js`, which caused the `grunt precommit:js` job to incorrectly remove the changes from `media-views.js`.

Fixes #32783.



git-svn-id: https://develop.svn.wordpress.org/trunk@36931 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2016-03-10 05:41:04 +00:00
parent 6abfb7a92a
commit ad57f8d6f9
1 changed files with 12 additions and 6 deletions

View File

@ -18,8 +18,10 @@ Cropper = wp.media.controller.State.extend({
toolbar: 'crop', toolbar: 'crop',
content: 'crop', content: 'crop',
router: false, router: false,
canSkipCrop: false,
canSkipCrop: false // Default doCrop Ajax arguments to allow the Customizer (for example) to inject state.
doCropArgs: {}
}, },
activate: function() { activate: function() {
@ -103,11 +105,15 @@ Cropper = wp.media.controller.State.extend({
}, },
doCrop: function( attachment ) { doCrop: function( attachment ) {
return wp.ajax.post( 'custom-header-crop', { return wp.ajax.post( 'custom-header-crop', _.extend(
nonce: attachment.get('nonces').edit, {},
id: attachment.get('id'), this.defaults.doCropArgs,
cropDetails: attachment.get('cropDetails') {
} ); nonce: attachment.get( 'nonces' ).edit,
id: attachment.get( 'id' ),
cropDetails: attachment.get( 'cropDetails' )
}
) );
} }
}); });