From b9b2f2a79d3506a74e3c3ce34de69ed069864dfe Mon Sep 17 00:00:00 2001 From: Anton Timmermans Date: Thu, 11 Jan 2018 14:31:14 +0000 Subject: [PATCH] Docs: Improve JS Docs for `controllers/customize-image-cropper.js`. Props manuelaugustin, bramheijmink, andizer, ireneyoast. Fixes #43020. git-svn-id: https://develop.svn.wordpress.org/trunk@42435 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/media-views.js | 26 +++++++++++++------ .../controllers/customize-image-cropper.js | 26 +++++++++++++------ 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js index c9c3a8af3e..60ad65ee48 100644 --- a/src/wp-includes/js/media-views.js +++ b/src/wp-includes/js/media-views.js @@ -2487,18 +2487,28 @@ var Controller = wp.media.controller, CustomizeImageCropper; /** - * wp.media.controller.CustomizeImageCropper + * A state for cropping an image in the customizer. * + * @since 4.3.0 + * + * @constructs wp.media.controller.CustomizeImageCropper * @memberOf wp.media.controller - * - * A state for cropping an image. - * - * @class - * @augments wp.media.controller.Cropper - * @augments wp.media.controller.State - * @augments Backbone.Model + * @augments wp.media.controller.CustomizeImageCropper.Cropper + * @inheritDoc */ CustomizeImageCropper = Controller.Cropper.extend(/** @lends wp.media.controller.CustomizeImageCropper.prototype */{ + /** + * Posts the crop details to the admin. + * + * Uses crop measurements when flexible in both directions. + * Constrains flexible side based on image ratio and size of the fixed side. + * + * @since 4.3.0 + * + * @param {Object} attachment The attachment to crop. + * + * @returns {$.promise} A jQuery promise that represents the crop image request. + */ doCrop: function( attachment ) { var cropDetails = attachment.get( 'cropDetails' ), control = this.get( 'control' ), diff --git a/src/wp-includes/js/media/controllers/customize-image-cropper.js b/src/wp-includes/js/media/controllers/customize-image-cropper.js index 5f076178ec..a9c2e9fc90 100644 --- a/src/wp-includes/js/media/controllers/customize-image-cropper.js +++ b/src/wp-includes/js/media/controllers/customize-image-cropper.js @@ -2,18 +2,28 @@ var Controller = wp.media.controller, CustomizeImageCropper; /** - * wp.media.controller.CustomizeImageCropper + * A state for cropping an image in the customizer. * + * @since 4.3.0 + * + * @constructs wp.media.controller.CustomizeImageCropper * @memberOf wp.media.controller - * - * A state for cropping an image. - * - * @class - * @augments wp.media.controller.Cropper - * @augments wp.media.controller.State - * @augments Backbone.Model + * @augments wp.media.controller.CustomizeImageCropper.Cropper + * @inheritDoc */ CustomizeImageCropper = Controller.Cropper.extend(/** @lends wp.media.controller.CustomizeImageCropper.prototype */{ + /** + * Posts the crop details to the admin. + * + * Uses crop measurements when flexible in both directions. + * Constrains flexible side based on image ratio and size of the fixed side. + * + * @since 4.3.0 + * + * @param {Object} attachment The attachment to crop. + * + * @returns {$.promise} A jQuery promise that represents the crop image request. + */ doCrop: function( attachment ) { var cropDetails = attachment.get( 'cropDetails' ), control = this.get( 'control' ),