@@ -79,6 +79,8 @@ Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{
7979 this . listenTo ( this . controller . states , 'attachment:compat:waiting attachment:compat:ready' , this . updateSave ) ;
8080 } ,
8181 /**
82+ * Update the view after the model has been saved.
83+ *
8284 * @return {wp.media.view.Attachment } Returns itself to allow chaining.
8385 */
8486 dispose : function ( ) {
@@ -97,6 +99,8 @@ Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{
9799 return this ;
98100 } ,
99101 /**
102+ * Renders the attachment view.
103+ *
100104 * @return {wp.media.view.Attachment } Returns itself to allow chaining.
101105 */
102106 render : function ( ) {
@@ -167,6 +171,8 @@ Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{
167171 } ,
168172
169173 /**
174+ * Toggles the selection state of the attachment.
175+ *
170176 * @param {Object } event
171177 */
172178 toggleSelectionHandler : function ( event ) {
@@ -221,6 +227,8 @@ Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{
221227 this . controller . trigger ( 'selection:toggle' ) ;
222228 } ,
223229 /**
230+ * Toggles the selection state of the attachment.
231+ *
224232 * @param {Object } options
225233 */
226234 toggleSelection : function ( options ) {
@@ -301,7 +309,9 @@ Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{
301309 this [ this . selected ( ) ? 'select' : 'deselect' ] ( ) ;
302310 } ,
303311 /**
304- * @return {unresolved|boolean }
312+ * Checks if the model is selected in the selection.
313+ *
314+ * @return {void|boolean } True if the model is selected in the selection, false otherwise.
305315 */
306316 selected : function ( ) {
307317 var selection = this . options . selection ;
@@ -310,6 +320,8 @@ Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{
310320 }
311321 } ,
312322 /**
323+ * Selects the model in the selection.
324+ *
313325 * @param {Backbone.Model } model
314326 * @param {Backbone.Collection } collection
315327 */
@@ -339,6 +351,8 @@ Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{
339351 }
340352 } ,
341353 /**
354+ * Deselects the model in the selection.
355+ *
342356 * @param {Backbone.Model } model
343357 * @param {Backbone.Collection } collection
344358 */
@@ -357,6 +371,8 @@ Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{
357371 . find ( '.check' ) . attr ( 'tabindex' , '-1' ) ;
358372 } ,
359373 /**
374+ * Updates the view to reflect whether the model is the single model in the selection.
375+ *
360376 * @param {Backbone.Model } model
361377 * @param {Backbone.Collection } collection
362378 */
@@ -372,8 +388,10 @@ Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{
372388 this . $el . toggleClass ( 'details' , details === this . model ) ;
373389 } ,
374390 /**
391+ * Gets the image size object for the specified size.
392+ *
375393 * @param {string } size
376- * @return {Object }
394+ * @return {Object } Returns an object containing the image size information.
377395 */
378396 imageSize : function ( size ) {
379397 var sizes = this . model . get ( 'sizes' ) , matched = false ;
@@ -405,6 +423,8 @@ Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{
405423 } ;
406424 } ,
407425 /**
426+ * Update the model's setting with the value from the input.
427+ *
408428 * @param {Object } event
409429 */
410430 updateSetting : function ( event ) {
@@ -456,6 +476,8 @@ Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{
456476 } ) ;
457477 } ,
458478 /**
479+ * Updates the view's save status.
480+ *
459481 * @param {string } status
460482 * @return {wp.media.view.Attachment } Returns itself to allow chaining.
461483 */
@@ -498,6 +520,8 @@ Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{
498520 }
499521 } ,
500522 /**
523+ * Removes the model from the collection.
524+ *
501525 * @param {Object } event
502526 */
503527 removeFromLibrary : function ( event ) {
@@ -513,11 +537,11 @@ Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{
513537 } ,
514538
515539 /**
516- * Add the model if it isn't in the selection, if it is in the selection,
517- * remove it.
540+ * Adds the model if it isn't in the selection, if it is in the selection,
541+ * removes it.
518542 *
519- * @param {[type] } event [description]
520- * @return {[type] } [description]
543+ * @param {Object } event
544+ * @return {void }
521545 */
522546 checkClickHandler : function ( event ) {
523547 var selection = this . options . selection ;
0 commit comments