Changeset 42996
- Timestamp:
- 04/22/2018 02:36:23 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/wp-backbone.js
r42993 r42996 21 21 * 22 22 * @param {wp.Backbone.View} view The main view. 23 * @param { array|Object} views The subviews for the main view.23 * @param {Array|Object} views The subviews for the main view. 24 24 */ 25 25 wp.Backbone.Subviews = function( view, views ) { … … 36 36 * @since 3.5.0 37 37 * 38 * @return { array} All the subviews.38 * @return {Array} All the subviews. 39 39 */ 40 40 all: function() { … … 52 52 * @param {string} selector A jQuery selector. 53 53 * 54 * @return { array}54 * @return {Array} All the subviews that match the selector. 55 55 */ 56 56 get: function( selector ) { … … 92 92 * resulting behavior. 93 93 * 94 * `options.silent` –*boolean, `false`*95 * >If `options.silent` is true, no DOM modifications will be made.96 * 97 * `options.add` –*boolean, `false`*98 * >Use `Views.add()` as a shortcut for setting `options.add` to true.99 * 100 * > By default, the provided `views` will replace101 * a ny existing views associated with the selector. If `options.add`102 * is true, the provided`views` will be added to the existing views.103 * 104 * `options.at` –*integer, `undefined`*105 * > When adding, to insert `views` at a specific index, use106 * `options.at`.By default, `views` are added to the end of the array.94 * `options.silent` - *boolean, `false`* 95 * If `options.silent` is true, no DOM modifications will be made. 96 * 97 * `options.add` - *boolean, `false`* 98 * Use `Views.add()` as a shortcut for setting `options.add` to true. 99 * 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. 103 * 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. 107 107 * 108 108 * @since 3.5.0 109 109 * 110 110 * @param {string} selector A jQuery selector. 111 * @param { array|Object} views The subviews for the main view.111 * @param {Array|Object} views The subviews for the main view. 112 112 * @param {Object} options Options for call. If `options.silent` is true, 113 113 * no DOM modifications will be made. Use … … 118 118 * `views` at a specific index, use `options.at`. 119 119 * 120 * @return wp.Backbone.Subviews120 * @return {wp.Backbone.Subviews} The current Subviews instance. 121 121 */ 122 122 set: function( selector, views, options ) { … … 198 198 * 199 199 * @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. 201 201 * @param {Object} options Options for call. To insert `views` at a 202 202 * specific index, use `options.at`. If … … 204 204 * will be made. 205 205 * 206 * @return wp.Backbone.Subviews206 * @return {wp.Backbone.Subviews} The current subviews instance. 207 207 */ 208 208 add: function( selector, views, options ) { … … 229 229 * 230 230 * @param {string} selector A jQuery selector. 231 * @param { array|object} views The subviews for the main view.231 * @param {Array|Object} views The subviews for the main view. 232 232 * @param {Object} options Options for call. If `options.silent` is set, 233 233 * `remove` will *not* be triggered on the … … 274 274 275 275 /** 276 * Renders all subviews 276 * Renders all subviews. 277 277 * 278 278 * Used in conjunction with `Views.detach()`. … … 296 296 297 297 /** 298 * Removes all subviews 298 * Removes all subviews. 299 299 * 300 300 * Triggers the `remove()` method on all subviews. Detaches the master … … 345 345 346 346 /** 347 * Insert subviews into a selector 347 * Insert subviews into a selector. 348 348 * 349 349 * By default, appends the subview `els` to the end of the `$target` … … 405 405 * @private 406 406 * 407 * @param {string} selector A jQuery selector.408 * @param { array|object} viewsThe subviews for the main view.409 * @param {Object} options Options for call.410 * @param {boolean} options.add 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. 411 411 * 412 412 * @return {wp.Backbone.Subviews} The current Subviews instance. … … 434 434 this[ options.add ? 'insert' : 'replace' ]( $selector, _.pluck( views, 'el' ), options ); 435 435 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 */ 438 440 _.each( managers, function( manager ) { 439 441 manager.attached = true; … … 453 455 * @private 454 456 * 455 * @return s{boolean} Whether or not the current view is in the DOM.457 * @return {boolean} Whether or not the current view is in the DOM. 456 458 */ 457 459 _isReady: function() { … … 481 483 * @since 3.6.0 Moved wp.media.View to wp.Backbone.View 482 484 * 483 * @memberOf wp.Backbone484 *485 485 * @constructs 486 486 * @augments Backbone.View 487 * 488 * @memberOf wp.Backbone 489 * 487 490 * 488 491 * @param {Object} options The options for this view. … … 498 501 499 502 /** 500 * @since 3.5.0501 *502 503 * Removes this view and all subviews. 504 * 505 * @since 3.5.0 506 * 507 * @return {wp.Backbone.Subviews} The current Subviews instance. 503 508 */ 504 509 remove: function() { … … 517 522 * @since 3.5.0 518 523 * 519 * @return s{wp.Backbone.View} The current instance of the view.524 * @return {wp.Backbone.View} The current instance of the view. 520 525 */ 521 526 render: function() { … … 542 547 * @since 3.5.0 543 548 * 544 * @return s{Object} The options for this view.549 * @return {Object} The options for this view. 545 550 */ 546 551 prepare: function() {
Note: See TracChangeset
for help on using the changeset viewer.