Make WordPress Core

Ticket #35465: 35465.7.diff

File 35465.7.diff, 4.4 KB (added by birgire, 7 years ago)
  • src/wp-includes/js/wp-backbone.js

    diff --git src/wp-includes/js/wp-backbone.js src/wp-includes/js/wp-backbone.js
    index 8b47f4e..d373f78 100644
    window.wp = window.wp || {}; 
    9191                 * Accepts an `options` object, which has a significant effect on the
    9292                 * resulting behavior.
    9393                 *
    94                  * `options.silent` – *boolean, `false`*
    95                  * > If `options.silent` is true, no DOM modifications will be made.
     94                 * `options.silent` - *boolean, `false`*
     95                 * If `options.silent` is true, no DOM modifications will be made.
    9696                 *
    97                  * `options.add` – *boolean, `false`*
    98                  * > Use `Views.add()` as a shortcut for setting `options.add` to true.
     97                 * `options.add` - *boolean, `false`*
     98                 * Use `Views.add()` as a shortcut for setting `options.add` to true.
    9999                 *
    100                  * > By default, the provided `views` will replace
    101                  * any existing views associated with the selector. If `options.add`
    102                  * is true, the provided `views` will be added to the existing views.
     100                 * By default, the provided `views` will replace any existing views
     101                 * associated with the selector. If `options.add` is true, the provided
     102                 * `views` will be added to the existing views.
    103103                 *
    104                  * `options.at` – *integer, `undefined`*
    105                  * > When adding, to insert `views` at a specific index, use
    106                  * `options.at`. By default, `views` are added to the end of the array.
     104                 * `options.at` - *integer, `undefined`*
     105                 * When adding, to insert `views` at a specific index, use `options.at`.
     106                 * By default, `views` are added to the end of the array.
    107107                 *
    108108                 * @since 3.5.0
    109109                 *
    window.wp = window.wp || {}; 
    197197                 * @since 3.5.0
    198198                 *
    199199                 * @param {string}       selector A jQuery selector.
    200                  * @param {array|object} views    The subviews for the main view.
     200                 * @param {array|Object} views    The subviews for the main view.
    201201                 * @param {Object}       options  Options for call.  To insert `views` at a
    202202                 *                                specific index, use `options.at`. If
    203203                 *                                `options.silent` is true, no DOM modifications
    window.wp = window.wp || {}; 
    273273                },
    274274
    275275                /**
    276                  * Renders all subviews
     276                 * Renders all subviews.
    277277                 *
    278278                 * Used in conjunction with `Views.detach()`.
    279279                 *
    window.wp = window.wp || {}; 
    295295                },
    296296
    297297                /**
    298                  * Removes all subviews
     298                 * Removes all subviews.
    299299                 *
    300300                 * Triggers the `remove()` method on all subviews. Detaches the master
    301301                 * view from its parent. Resets the internals of the views manager.
    window.wp = window.wp || {}; 
    344344                },
    345345
    346346                /**
    347                  * Insert subviews into a selector
     347                 * Insert subviews into a selector.
    348348                 *
    349349                 * By default, appends the subview `els` to the end of the `$target`
    350350                 * selector. If `options.at` is set, inserts the subview `els` at the
    window.wp = window.wp || {}; 
    404404                 *
    405405                 * @private
    406406                 *
    407                  * @param {string}       selector A jQuery selector.
    408                  * @param {array|object} views    The subviews for the main view.
    409                  * @param {Object}       options  Options for call.
    410                  * @param {boolean}      options.add  If true the provided views will be added.
     407                 * @param {string}       selector    A jQuery selector.
     408                 * @param {array|object} views       The subviews for the main view.
     409                 * @param {Object}       options     Options for call.
     410                 * @param {boolean}      options.add If true the provided views will be added.
    411411                 *
    412412                 * @return {wp.Backbone.Subviews} The current Subviews instance.
    413413                 */
    window.wp = window.wp || {}; 
    433433                        // Insert or replace the views.
    434434                        this[ options.add ? 'insert' : 'replace' ]( $selector, _.pluck( views, 'el' ), options );
    435435
    436                         // Set attached and trigger ready if the current view is already
    437                         // attached to the DOM.
     436                        /*
     437                         * Set attached and trigger ready if the current view is already
     438                         * attached to the DOM.
     439                         */
    438440                        _.each( managers, function( manager ) {
    439441                                manager.attached = true;
    440442
    window.wp = window.wp || {}; 
    452454                 *
    453455                 * @private
    454456                 *
    455                  * @returns {boolean} Whether or not the current view is in the DOM.
     457                 * @return {boolean} Whether or not the current view is in the DOM.
    456458                 */
    457459                _isReady: function() {
    458460                        var node = this.view.el;
    window.wp = window.wp || {}; 
    483485                 * @memberOf wp.Backbone
    484486                 *
    485487                 * @constructs
    486                  * @augments Backbone.View
     488                 * @augments   Backbone.View
    487489                 *
    488490                 * @param {Object} options The options for this view.
    489491                 */