diff --git src/wp-includes/js/media-models.js src/wp-includes/js/media-models.js
index 2e406d7..0405b56 100644
|
|
|
window.wp = window.wp || {}; |
| 320 | 320 | }, data ) ).done( function( resp, status, xhr ) { |
| 321 | 321 | model.set( model.parse( resp, xhr ), options ); |
| 322 | 322 | }); |
| | 323 | }, |
| | 324 | crop: function() { |
| | 325 | return wp.ajax.post( 'custom-header-crop', { |
| | 326 | nonce: this.get('nonces').edit, |
| | 327 | id: this.get('id'), |
| | 328 | cropDetails: this.get('cropDetails') |
| | 329 | } ); |
| 323 | 330 | } |
| 324 | 331 | }, { |
| 325 | 332 | /** |
diff --git src/wp-includes/js/media-views.js src/wp-includes/js/media-views.js
index 4c2114c..56684c4 100644
|
|
|
|
| 1367 | 1367 | |
| 1368 | 1368 | click: function() { |
| 1369 | 1369 | var self = this, |
| 1370 | | selection = this.controller.state().get('selection').first(); |
| | 1370 | selection = new media.model.Attachment(this.controller.state().get('selection').first().attributes); |
| 1371 | 1371 | |
| 1372 | 1372 | selection.set({cropDetails: this.controller.state().imgSelect.getSelection()}); |
| 1373 | 1373 | |
| 1374 | 1374 | this.$el.text(l10n.cropping); |
| 1375 | 1375 | this.$el.attr('disabled', true); |
| 1376 | | this.controller.state().doCrop( selection ).done( function( croppedImage ) { |
| | 1376 | selection.crop().done( function( croppedImage ) { |
| 1377 | 1377 | self.controller.trigger('cropped', croppedImage ); |
| 1378 | 1378 | self.controller.close(); |
| 1379 | 1379 | }); |
| … |
… |
|
| 1400 | 1400 | } |
| 1401 | 1401 | |
| 1402 | 1402 | this.frame.toolbar.set( new wp.media.view.Toolbar(toolbarOptions) ); |
| 1403 | | }, |
| 1404 | | |
| 1405 | | doCrop: function( attachment ) { |
| 1406 | | return wp.ajax.post( 'custom-header-crop', { |
| 1407 | | nonce: attachment.get('nonces').edit, |
| 1408 | | id: attachment.get('id'), |
| 1409 | | cropDetails: attachment.get('cropDetails') |
| 1410 | | } ); |
| 1411 | 1403 | } |
| 1412 | 1404 | }); |
| 1413 | 1405 | |