diff options
Diffstat (limited to 'contexts/data/lib/closure-library/closure/goog/ui/media/mediamodel.js')
-rw-r--r-- | contexts/data/lib/closure-library/closure/goog/ui/media/mediamodel.js | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/contexts/data/lib/closure-library/closure/goog/ui/media/mediamodel.js b/contexts/data/lib/closure-library/closure/goog/ui/media/mediamodel.js index 8748999..1fd2886 100644 --- a/contexts/data/lib/closure-library/closure/goog/ui/media/mediamodel.js +++ b/contexts/data/lib/closure-library/closure/goog/ui/media/mediamodel.js @@ -140,7 +140,7 @@ goog.ui.media.MediaModel = function(opt_url, /** * The list of credits that pertain to this media object. - * @type {Array.<goog.ui.media.MediaModel.Credit>} + * @type {!Array.<goog.ui.media.MediaModel.Credit>} * @private */ this.credits_ = []; @@ -434,7 +434,7 @@ goog.ui.media.MediaModel.prototype.findCategoryWithScheme = function(scheme) { /** * Gets the credits of the media. - * @return {Array.<goog.ui.media.MediaModel.Credit>} The credits of the media. + * @return {!Array.<goog.ui.media.MediaModel.Credit>} The credits of the media. */ goog.ui.media.MediaModel.prototype.getCredits = function() { return this.credits_; @@ -443,7 +443,7 @@ goog.ui.media.MediaModel.prototype.getCredits = function() { /** * Sets the credits of the media - * @param {Array.<goog.ui.media.MediaModel.Credit>} credits The credits of the + * @param {!Array.<goog.ui.media.MediaModel.Credit>} credits The credits of the * media. * @return {!goog.ui.media.MediaModel} The object itself, used for chaining. */ @@ -454,19 +454,16 @@ goog.ui.media.MediaModel.prototype.setCredits = function(credits) { /** - * Finds the first credit with the given role. + * Finds all credits with the given role. * @param {string} role The role to search for. - * @return {goog.ui.media.MediaModel.Credit} The credit object that has the - * given role. May be null. + * @return {!Array.<!goog.ui.media.MediaModel.Credit>} An array of credits + * with the given role. May be empty. */ -goog.ui.media.MediaModel.prototype.findCreditWithRole = function(role) { - if (!this.credits_) { - return null; - } - var credit = goog.array.find(this.credits_, function(credit) { +goog.ui.media.MediaModel.prototype.findCreditsWithRole = function(role) { + var credits = goog.array.filter(this.credits_, function(credit) { return role == credit.getRole(); }); - return /** @type {goog.ui.media.MediaModel.Credit} */ (credit); + return /** @type {!Array.<!goog.ui.media.MediaModel.Credit>} */ (credits); }; |