Make WordPress Core

Changeset 28989


Ignore:
Timestamp:
07/04/2014 01:42:27 AM (12 years ago)
Author:
wonderboymusic
Message:

Add more docs for media.view.MediaFrame.Select methods.

Props ericlewis.
See #28459.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media-views.js

    r28839 r28989  
    21412141                },
    21422142
     2143                /**
     2144                 * Attach a selection collection to the frame.
     2145                 *
     2146                 * A selection is a collection of attachments used for a specific purpose
     2147                 * by a media frame. e.g. Selecting an attachment (or many) to insert into
     2148                 * post content.
     2149                 *
     2150                 * @see media.model.Selection
     2151                 */
    21432152                createSelection: function() {
    21442153                        var selection = this.options.selection;
    … …  
    21562165                },
    21572166
     2167                /**
     2168                 * Create the default states on the frame.
     2169                 */
    21582170                createStates: function() {
    21592171                        var options = this.options;
    … …  
    21752187                },
    21762188
     2189                /**
     2190                 * Bind region mode event callbacks.
     2191                 *
     2192                 * @see media.controller.Region.render
     2193                 */
    21772194                bindHandlers: function() {
    21782195                        this.on( 'router:create:browse', this.createRouter, this );
    … …  
    21832200                },
    21842201
    2185                 // Routers
    2186                 browseRouter: function( view ) {
    2187                         view.set({
     2202                /**
     2203                 * Render callback for the router region in the `browse` mode.
     2204                 *
     2205                 * @param {wp.media.view.Router} routerView
     2206                 */
     2207                browseRouter: function( routerView ) {
     2208                        routerView.set({
    21882209                                upload: {
    21892210                                        text:     l10n.uploadFilesTitle,
    … …  
    21982219
    21992220                /**
    2200                  * Content
     2221                 * Render callback for the content region in the `browse` mode.
    22012222                 *
    2202                  * @param {Object} content
    2203                  * @this wp.media.controller.Region
    2204                  */
    2205                 browseContent: function( content ) {
     2223                 * @param {wp.media.controller.Region} contentRegion
     2224                 */
     2225                browseContent: function( contentRegion ) {
    22062226                        var state = this.state();
    22072227
    … …  
    22092229
    22102230                        // Browse our library of attachments.
    2211                         content.view = new media.view.AttachmentsBrowser({
     2231                        contentRegion.view = new media.view.AttachmentsBrowser({
    22122232                                controller: this,
    22132233                                collection: state.get('library'),
    … …  
    22282248
    22292249                /**
    2230                  *
    2231                  * @this wp.media.controller.Region
     2250                 * Render callback for the content region in the `upload` mode.
    22322251                 */
    22332252                uploadContent: function() {
    2234                         this.$el.removeClass('hide-toolbar');
     2253                        this.$el.removeClass( 'hide-toolbar' );
    22352254                        this.content.set( new media.view.UploaderInline({
    22362255                                controller: this
Note: See TracChangeset for help on using the changeset viewer.