- Timestamp:
- 12/03/2017 06:46:29 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/media/controllers/cropper.js
r41351 r42352 5 5 * wp.media.controller.Cropper 6 6 * 7 * A state for cropping an image.7 * A class for cropping an image when called from the header media customization panel. 8 8 * 9 9 * @memberOf wp.media.controller … … 27 27 }, 28 28 29 /** 30 * @summary Opens the crop image window. 31 * 32 * Shows the crop image window when called from the Add new image button. 33 * 34 * @since 4.2.0 35 * 36 * @returns {void} 37 */ 29 38 activate: function() { 30 39 this.frame.on( 'content:create:crop', this.createCropContent, this ); … … 33 42 }, 34 43 44 /** 45 * @summary Changes the state of the toolbar window to browse mode. 46 * 47 * @since 4.2.0 48 * 49 * @returns {void} 50 */ 35 51 deactivate: function() { 36 52 this.frame.toolbar.mode('browse'); 37 53 }, 38 54 55 /** 56 * @summary Creates the crop image window. 57 * 58 * Initialized when clicking on the Select and Crop button. 59 * 60 * @since 4.2.0 61 * 62 * @fires crop window 63 * 64 * @returns {void} 65 */ 39 66 createCropContent: function() { 40 67 this.cropperView = new wp.media.view.Cropper({ … … 46 73 47 74 }, 75 76 /** 77 * @summary Removes the image selection and closes the cropping window. 78 * 79 * @since 4.2.0 80 * 81 * @returns {void} 82 */ 48 83 removeCropper: function() { 49 84 this.imgSelect.cancelSelection(); … … 52 87 this.cropperView.remove(); 53 88 }, 89 90 /** 91 * @summary Checks if cropping can be skipped and creates crop toolbar accordingly. 92 * 93 * @since 4.2.0 94 * 95 * @returns {void} 96 */ 54 97 createCropToolbar: function() { 55 98 var canSkipCrop, toolbarOptions; … … 107 150 }, 108 151 152 /** 153 * @summary Creates an object with the image attachment and crop properties. 154 * 155 * @since 4.2.0 156 * 157 * @returns {$.promise} A jQuery promise with the custom header crop details. 158 */ 109 159 doCrop: function( attachment ) { 110 160 return wp.ajax.post( 'custom-header-crop', _.extend(
Note: See TracChangeset
for help on using the changeset viewer.