From 8c547ce5215f9af2beb5964107827e46b047bf49 Mon Sep 17 00:00:00 2001 From: Anton Timmermans Date: Thu, 3 May 2018 14:39:25 +0000 Subject: [PATCH] Docs: Improve JSDoc for `media/controllers/gallery-edit.js`. Props Xyfi, nataliashitova, igorsch, ireneyoast, manuelaugustin. Fixes #43866. git-svn-id: https://develop.svn.wordpress.org/trunk@43141 602fd350-edb4-49c9-b593-d223f7449a82 --- .../js/media/controllers/gallery-edit.js | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/js/media/controllers/gallery-edit.js b/src/wp-includes/js/media/controllers/gallery-edit.js index 252ce65869..01c00be019 100644 --- a/src/wp-includes/js/media/controllers/gallery-edit.js +++ b/src/wp-includes/js/media/controllers/gallery-edit.js @@ -16,7 +16,7 @@ var Library = wp.media.controller.Library, * * @memberOf wp.media.controller * - * @param {object} [attributes] The attributes hash passed to the state. + * @param {Object} [attributes] The attributes hash passed to the state. * @param {string} [attributes.id=gallery-edit] Unique identifier. * @param {string} [attributes.title=Edit Gallery] Title for the state. Displays in the frame's title region. * @param {wp.media.model.Attachments} [attributes.library] The collection of attachments in the gallery. @@ -59,7 +59,14 @@ GalleryEdit = Library.extend(/** @lends wp.media.controller.GalleryEdit.prototyp }, /** + * Initializes the library. + * + * Creates a selection if a library isn't supplied and creates an attachment + * view if no attachment view is supplied. + * * @since 3.5.0 + * + * @return {void} */ initialize: function() { // If we haven't been provided a `library`, create a `Selection`. @@ -76,7 +83,14 @@ GalleryEdit = Library.extend(/** @lends wp.media.controller.GalleryEdit.prototyp }, /** + * Activates the library. + * + * Limits the library to images, watches for uploaded attachments. Watches for + * the browse event on the frame and binds it to gallerySettings. + * * @since 3.5.0 + * + * @return {void} */ activate: function() { var library = this.get('library'); @@ -93,7 +107,13 @@ GalleryEdit = Library.extend(/** @lends wp.media.controller.GalleryEdit.prototyp }, /** + * Deactivates the library. + * + * Stops watching for uploaded attachments and browse events. + * * @since 3.5.0 + * + * @return {void} */ deactivate: function() { // Stop watching for uploaded attachments. @@ -105,9 +125,14 @@ GalleryEdit = Library.extend(/** @lends wp.media.controller.GalleryEdit.prototyp }, /** + * Adds the gallery settings to the sidebar and adds a reverse button to the + * toolbar. + * * @since 3.5.0 * - * @param browser + * @param {wp.media.view.Frame} browser The file browser. + * + * @return {void} */ gallerySettings: function( browser ) { if ( ! this.get('displaySettings') ) {