WordPress.org

Make WordPress Core

Changeset 27126


Ignore:
Timestamp:
02/07/2014 08:20:38 PM (8 years ago)
Author:
wonderboymusic
Message:

Add some inline docs to media-views.js and remove some unnecessary comments from a few super calls.

Props gcorne.
See #26870.

File:
1 edited

Legend:

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

    r27105 r27126  
    297297    /**
    298298     * wp.media.controller.State
     299     *
     300     * A state is a step in a workflow that when set will trigger
     301     * the controllers for the regions to be updated as specified. This
     302     * class is the base class that the various states used in the media
     303     * modals extend.
    299304     *
    300305     * @constructor
     
    793798                this.set( 'AttachmentView', media.view.Attachment.EditLibrary );
    794799            }
    795             /**
    796              * call 'initialize' directly on the parent class
    797              */
     800
    798801            media.controller.Library.prototype.initialize.apply( this, arguments );
    799802        },
     
    809812
    810813            this.frame.on( 'content:render:browse', this.gallerySettings, this );
    811             /**
    812              * call 'activate' directly on the parent class
    813              */
     814
    814815            media.controller.Library.prototype.activate.apply( this, arguments );
    815816        },
     
    820821
    821822            this.frame.off( 'content:render:browse', this.gallerySettings, this );
    822             /**
    823              * call 'deactivate' directly on the parent class
    824              */
     823
    825824            media.controller.Library.prototype.deactivate.apply( this, arguments );
    826825        },
     
    887886                this.set( 'library', media.query({ type: 'image' }) );
    888887            }
    889             /**
    890              * call 'initialize' directly on the parent class
    891              */
    892888            media.controller.Library.prototype.initialize.apply( this, arguments );
    893889        },
     
    904900            // that do not exist in gallery's library.
    905901            library.validator = function( attachment ) {
    906                 return !! this.mirroring.get( attachment.cid )
    907                     && ! edit.get( attachment.cid )
    908                     /**
    909                      * call 'validator' directly on wp.media.model.Selection
    910                      */
    911                     && media.model.Selection.prototype.validator.apply( this, arguments );
     902                return !! this.mirroring.get( attachment.cid ) && ! edit.get( attachment.cid ) &&
     903                    media.model.Selection.prototype.validator.apply( this, arguments );
    912904            };
    913905
     
    918910            library.observe( edit );
    919911            this.editLibrary = edit;
    920             /**
    921              * call 'activate' directly on the parent class
    922              */
     912
    923913            media.controller.Library.prototype.activate.apply( this, arguments );
    924914        }
     
    951941                this.set( 'library', media.query({ type: 'image' }) );
    952942            }
    953             /**
    954              * call 'initialize' directly on the parent class
    955              */
     943
    956944            media.controller.Library.prototype.initialize.apply( this, arguments );
    957945
     
    982970            this.updateSelection();
    983971            this.frame.on( 'open', this.updateSelection, this );
    984             /**
    985              * call 'activate' directly on the parent class
    986              */
     972
    987973            media.controller.Library.prototype.activate.apply( this, arguments );
    988974        },
     
    990976        deactivate: function() {
    991977            this.frame.off( 'open', this.updateSelection, this );
    992             /**
    993              * call 'deactivate' directly on the parent class
    994              */
     978
    995979            media.controller.Library.prototype.deactivate.apply( this, arguments );
    996980        },
     
    10391023                this.set( 'library', media.query({ type: 'image' }) );
    10401024            }
    1041             /**
    1042              * call 'initialize' directly on the parent class
    1043              */
     1025
    10441026            media.controller.Library.prototype.initialize.apply( this, arguments );
    10451027
     
    10691051        activate: function() {
    10701052            this.updateSelection();
    1071             /**
    1072              * call 'activate' directly on the parent class
    1073              */
    10741053            media.controller.Library.prototype.activate.apply( this, arguments );
    1075         },
    1076 
    1077         deactivate: function() {
    1078             /**
    1079              * call 'deactivate' directly on the parent class
    1080              */
    1081             media.controller.Library.prototype.deactivate.apply( this, arguments );
    10821054        },
    10831055
     
    12691241     * wp.media.view.Frame
    12701242     *
     1243     * A frame is a composite view consisting of one or more regions and one or more
     1244     * states. Only one state can be active at any given moment.
     1245     *
    12711246     * @constructor
    12721247     * @augments wp.media.View
     
    13281303     * wp.media.view.MediaFrame
    13291304     *
     1305     * Type of frame used to create the media modal.
     1306     *
    13301307     * @constructor
    13311308     * @augments wp.media.view.Frame
     
    13441321         */
    13451322        initialize: function() {
    1346             /**
    1347              * call 'initialize' directly on the parent class
    1348              */
     1323
    13491324            media.view.Frame.prototype.initialize.apply( this, arguments );
    13501325
     
    15501525    /**
    15511526     * wp.media.view.MediaFrame.Select
     1527     *
     1528     * Type of media frame that is used to select an item or items from the media library
    15521529     *
    15531530     * @constructor
Note: See TracChangeset for help on using the changeset viewer.