Skip to content

Commit

Permalink
Merge pull request #20 from ronaldbarendse/master
Browse files Browse the repository at this point in the history
Added AltText property to GridControlMediaValue
  • Loading branch information
abjerner committed Jan 18, 2018
2 parents 1ec6154 + 02368e0 commit ef781df
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Skybrud.Umbraco.GridData/Values/GridControlMediaValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ public class GridControlMediaValue : GridControlValueBase {
[JsonProperty("image")]
public string Image { get; protected set; }

/// <summary>
/// Gets the alt text of the media.
/// </summary>
[JsonProperty("altText", NullValueHandling = NullValueHandling.Ignore)]
public string AltText { get; protected set; }

/// <summary>
/// Gets whether the <see cref="AltText"/> property has a value.
/// </summary>
public bool HasAltText
{
get { return !String.IsNullOrWhiteSpace(AltText); }
}

/// <summary>
/// Gets the caption of the media.
/// </summary>
Expand Down Expand Up @@ -66,6 +80,7 @@ public class GridControlMediaValue : GridControlValueBase {
FocalPoint = obj.GetObject("focalPoint", GridControlMediaFocalPoint.Parse);
Id = obj.GetInt32("id");
Image = obj.GetString("image");
AltText = obj.GetString("altText");
Caption = obj.GetString("caption");
}

Expand Down

0 comments on commit ef781df

Please sign in to comment.