WordPress.org

Make WordPress Core

Ticket #43866: gallery-edit.diff

File gallery-edit.diff, 4.3 KB (added by manuelaugustin, 4 years ago)
  • src/wp-includes/js/media/controllers/gallery-edit.js

    diff --git src/wp-includes/js/media/controllers/gallery-edit.js src/wp-includes/js/media/controllers/gallery-edit.js
    index b07056e..34d57cc 100644
    var Library = wp.media.controller.Library, 
    77 *
    88 * A state for editing a gallery's images and settings.
    99 *
     10 * @since 3.5.0
     11 *
    1012 * @memberOf wp.media.controller
    1113 *
    1214 * @class
    var Library = wp.media.controller.Library, 
    1416 * @augments wp.media.controller.State
    1517 * @augments Backbone.Model
    1618 *
    17  * @param {object}                     [attributes]                       The attributes hash passed to the state.
     19 * @param {Object}                     [attributes]                       The attributes hash passed to the state.
    1820 * @param {string}                     [attributes.id=gallery-edit]       Unique identifier.
    1921 * @param {string}                     [attributes.title=Edit Gallery]    Title for the state. Displays in the frame's title region.
    2022 * @param {wp.media.model.Attachments} [attributes.library]               The collection of attachments in the gallery.
    var Library = wp.media.controller.Library, 
    2830 * @param {boolean}                    [attributes.describe=true]         Whether to offer UI to describe attachments - e.g. captioning images in a gallery.
    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.
    3638 * @param {view}                       [attributes.AttachmentView]        The single `Attachment` view to be used in the `Attachments`.
    GalleryEdit = Library.extend(/** @lends wp.media.controller.GalleryEdit.prototyp 
    5759        },
    5860
    5961        /**
     62         * Initializes the library.
     63         *
     64         * Creates a selection if a library isn't supplied
     65         * and creates an attachment view if no attachment view is supplied.
     66         *
    6067         * @since 3.5.0
     68         *
     69         * @returns {void}
    6170         */
    6271        initialize: function() {
    6372                // If we haven't been provided a `library`, create a `Selection`.
    GalleryEdit = Library.extend(/** @lends wp.media.controller.GalleryEdit.prototyp 
    7483        },
    7584
    7685        /**
     86         * Activates the library.
     87         *
     88         * Limits the library to images, watches for uploaded attachments.
     89         * Watches for the browse event on the frame and binds it to
     90         * gallerySettings.
     91         *
    7792         * @since 3.5.0
     93         *
     94         * @returns {void}
    7895         */
    7996        activate: function() {
    8097                var library = this.get('library');
    GalleryEdit = Library.extend(/** @lends wp.media.controller.GalleryEdit.prototyp 
    91108        },
    92109
    93110        /**
     111         * Deactivates the library.
     112         *
     113         * Stops watching for uploaded attachments and browse events.
     114         *
    94115         * @since 3.5.0
     116         *
     117         * @returns {void}
    95118         */
    96119        deactivate: function() {
    97120                // Stop watching for uploaded attachments.
    GalleryEdit = Library.extend(/** @lends wp.media.controller.GalleryEdit.prototyp 
    103126        },
    104127
    105128        /**
     129         * Adds the gallery settings to the side bar and adds a reverse button to the toolbar.
     130         *
    106131         * @since 3.5.0
    107132         *
    108          * @param browser
     133         * @param {wp.media.view.Frame} browser The file browser.
     134         *
     135         * @returns {void}
    109136         */
    110137        gallerySettings: function( browser ) {
    111138                if ( ! this.get('displaySettings') ) {