WordPress.org

Make WordPress Core

Changeset 37042


Ignore:
Timestamp:
03/22/2016 03:54:58 AM (6 years ago)
Author:
westonruter
Message:

Customize: Add support for flex sizes in CustomizeImageCropper.

Ensures that $flex_width and $flex_height as specified on WP_Customize_Cropped_Image_Control will be honored when a crop is saved.

See #36255.
Fixes #34851.

Location:
trunk/src/wp-includes/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media-views.js

    r36866 r37042  
    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', {
  • trunk/src/wp-includes/js/media/controllers/customize-image-cropper.js

    r33337 r37042  
    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', {
Note: See TracChangeset for help on using the changeset viewer.