Make WordPress Core

Ticket #34851: 34851.diff

File 34851.diff, 1.5 KB (added by westonruter, 8 years ago)
  • src/wp-includes/js/media-views.js

    diff --git src/wp-includes/js/media-views.js src/wp-includes/js/media-views.js
    index 015ec23..7be6868 100644
    CustomizeImageCropper = Controller.Cropper.extend({ 
    402402                var cropDetails = attachment.get( 'cropDetails' ),
    403403                        control = this.get( 'control' );
    404404
    405                 cropDetails.dst_width  = control.params.width;
    406                 cropDetails.dst_height = control.params.height;
     405                if ( ! control.params.flex_width ) {
     406                        cropDetails.dst_width = control.params.width;
     407                }
     408                if ( ! control.params.flex_height ) {
     409                        cropDetails.dst_height = control.params.height;
     410                }
    407411
    408412                return wp.ajax.post( 'crop-image', {
    409413                        wp_customize: 'on',
  • src/wp-includes/js/media/controllers/customize-image-cropper.js

    diff --git src/wp-includes/js/media/controllers/customize-image-cropper.js src/wp-includes/js/media/controllers/customize-image-cropper.js
    index dbaa8f8..df2d77b 100644
    CustomizeImageCropper = Controller.Cropper.extend({ 
    1616                var cropDetails = attachment.get( 'cropDetails' ),
    1717                        control = this.get( 'control' );
    1818
    19                 cropDetails.dst_width  = control.params.width;
    20                 cropDetails.dst_height = control.params.height;
     19                if ( ! control.params.flex_width ) {
     20                        cropDetails.dst_width = control.params.width;
     21                }
     22                if ( ! control.params.flex_height ) {
     23                        cropDetails.dst_height = control.params.height;
     24                }
    2125
    2226                return wp.ajax.post( 'crop-image', {
    2327                        wp_customize: 'on',