Make WordPress Core

Changeset 42798


Ignore:
Timestamp:
03/08/2018 04:24:16 PM (8 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve JSDoc for wp-includes/js/media/controllers/gallery-add.js.

Props boblinthorst, bramheijmink, manuelaugustin, ireneyoast, igorsch, nataliashitova.
Fixes #43500.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media/controllers/gallery-add.js

    r41351 r42798  
    99 * A state for selecting more images to add to a gallery.
    1010 *
    11  * @memberOf wp.media.controller
     11 * @since 3.5.0
    1212 *
    1313 * @class
     
    1616 * @augments Backbone.Model
    1717 *
    18  * @param {object}                     [attributes]                         The attributes hash passed to the state.
     18 * @memberof wp.media.controller
     19 *
     20 * @param {Object}                     [attributes]                         The attributes hash passed to the state.
    1921 * @param {string}                     [attributes.id=gallery-library]      Unique identifier.
    2022 * @param {string}                     [attributes.title=Add to Gallery]    Title for the state. Displays in the frame's title region.
     
    3335 * @param {boolean}                    [attributes.autoSelect=true]         Whether an uploaded attachment should be automatically added to the selection.
    3436 * @param {boolean}                    [attributes.contentUserSetting=true] Whether the content region's mode should be set and persisted per user.
    35  * @param {int}                        [attributes.priority=100]            The priority for the state link in the media menu.
     37 * @param {number}                     [attributes.priority=100]            The priority for the state link in the media menu.
    3638 * @param {boolean}                    [attributes.syncSelection=false]     Whether the Attachments selection should be persisted from the last state.
    3739 *                                                                          Defaults to false because for this state, because the library of the Edit Gallery state is the selection.
     
    5052
    5153        /**
     54         * Initializes the library. Creates a library of images if a library isn't supplied.
     55         *
    5256         * @since 3.5.0
     57         *
     58         * @returns {void}
    5359         */
    5460        initialize: function() {
    55                 // If a library wasn't supplied, create a library of images.
    5661                if ( ! this.get('library') ) {
    5762                        this.set( 'library', wp.media.query({ type: 'image' }) );
     
    6267
    6368        /**
     69         * Activates the library.
     70         *
     71         * Removes all event listeners if in edit mode. Creates a validator to check an attachment.
     72         * Resets library and re-enables event listeners. Activates edit mode. Calls the parent's activate method.
     73         *
    6474         * @since 3.5.0
     75         *
     76         * @returns {void}
    6577         */
    6678        activate: function() {
     
    7284                }
    7385
    74                 // Accepts attachments that exist in the original library and
    75                 // that do not exist in gallery's library.
     86                /*
     87                 * Accept attachments that exist in the original library but
     88                 * that do not exist in gallery's library yet.
     89                 */
    7690                library.validator = function( attachment ) {
    7791                        return !! this.mirroring.get( attachment.cid ) && ! edit.get( attachment.cid ) && Selection.prototype.validator.apply( this, arguments );
    7892                };
    7993
    80                 // Reset the library to ensure that all attachments are re-added
    81                 // to the collection. Do so silently, as calling `observe` will
    82                 // trigger the `reset` event.
     94                /*
     95                 * Reset the library to ensure that all attachments are re-added
     96                 * to the collection. Do so silently, as calling `observe` will
     97                 * trigger the `reset` event.
     98                 */
    8399                library.reset( library.mirroring.models, { silent: true });
    84100                library.observe( edit );
  • trunk/src/wp-includes/js/media/controllers/gallery-edit.js

    r41351 r42798  
    88 * A state for editing a gallery's images and settings.
    99 *
    10  * @memberOf wp.media.controller
     10 * @since 3.5.0
    1111 *
    1212 * @class
     
    1414 * @augments wp.media.controller.State
    1515 * @augments Backbone.Model
     16 *
     17 * @memberOf wp.media.controller
    1618 *
    1719 * @param {object}                     [attributes]                       The attributes hash passed to the state.
     
    2931 * @param {boolean}                    [attributes.displaySettings=true]  Whether to show the attachment display settings interface.
    3032 * @param {boolean}                    [attributes.dragInfo=true]         Whether to show instructional text about the attachments being sortable.
    31  * @param {int}                        [attributes.idealColumnWidth=170]  The ideal column width in pixels for attachments.
     33 * @param {number}                     [attributes.idealColumnWidth=170]  The ideal column width in pixels for attachments.
    3234 * @param {boolean}                    [attributes.editing=false]         Whether the gallery is being created, or editing an existing instance.
    33  * @param {int}                        [attributes.priority=60]           The priority for the state link in the media menu.
     35 * @param {number}                     [attributes.priority=60]           The priority for the state link in the media menu.
    3436 * @param {boolean}                    [attributes.syncSelection=false]   Whether the Attachments selection should be persisted from the last state.
    3537 *                                                                        Defaults to false for this state, because the library passed in  *is* the selection.
Note: See TracChangeset for help on using the changeset viewer.