Media: Add a method to fetch the first subview. see #21390.
git-svn-id: https://develop.svn.wordpress.org/trunk@22682 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
17af1e2366
commit
aa6b7069e6
@ -592,6 +592,19 @@
|
|||||||
return this._views[ selector ];
|
return this._views[ selector ];
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// ### Get a selector's first subview
|
||||||
|
//
|
||||||
|
// Fetches the first subview that matches a given `selector`.
|
||||||
|
//
|
||||||
|
// If no `selector` is provided, it will grab the first subview
|
||||||
|
// attached to the view's root.
|
||||||
|
//
|
||||||
|
// Useful when a selector only has one subview at a time.
|
||||||
|
first: function( selector ) {
|
||||||
|
var views = this.get( selector );
|
||||||
|
return views && views.length ? views[0] : null;
|
||||||
|
},
|
||||||
|
|
||||||
// ### Register subview(s)
|
// ### Register subview(s)
|
||||||
//
|
//
|
||||||
// Registers any number of `views` to a `selector`.
|
// Registers any number of `views` to a `selector`.
|
||||||
|
Loading…
Reference in New Issue
Block a user