wp/wp-includes/js/wp-backbone.js
changeset 7 cf61fcea0001
parent 5 5e2f62d02dcd
child 9 177826044cd9
equal deleted inserted replaced
6:490d5cc509ed 7:cf61fcea0001
       
     1 /** @namespace wp */
     1 window.wp = window.wp || {};
     2 window.wp = window.wp || {};
     2 
     3 
     3 (function ($) {
     4 (function ($) {
     4 	// Create the WordPress Backbone namespace.
     5 	/**
       
     6 	 * Create the WordPress Backbone namespace.
       
     7 	 *
       
     8 	 * @namespace wp.Backbone
       
     9 	 */
     5 	wp.Backbone = {};
    10 	wp.Backbone = {};
     6 
    11 
     7 
    12 
     8 	// wp.Backbone.Subviews
    13 	// wp.Backbone.Subviews
     9 	// --------------------
    14 	// --------------------
    19 	_.extend( wp.Backbone.Subviews.prototype, {
    24 	_.extend( wp.Backbone.Subviews.prototype, {
    20 		// ### Fetch all of the subviews
    25 		// ### Fetch all of the subviews
    21 		//
    26 		//
    22 		// Returns an array of all subviews.
    27 		// Returns an array of all subviews.
    23 		all: function() {
    28 		all: function() {
    24 			return _.flatten( this._views );
    29 			return _.flatten( _.values( this._views ) ); 
    25 		},
    30 		},
    26 
    31 
    27 		// ### Get a selector's subviews
    32 		// ### Get a selector's subviews
    28 		//
    33 		//
    29 		// Fetches all subviews that match a given `selector`.
    34 		// Fetches all subviews that match a given `selector`.