Skip to content

Commit

Permalink
Merged the if conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
nileshgnagepatil committed Oct 4, 2023
1 parent 4711907 commit aaf70c7
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions Childrens-Social-Care-CPD/Views/Content/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,17 @@
@_relatedContentRenderer.Render(Model.RelatedContent)

@section Scripts {
@if (ViewData.TryGetValue("StateModel", out var stateModel))
@if (ViewData.TryGetValue("StateModel", out var stateModel) && ((StateModel)stateModel).IncludeMediaPlayer)
{
if (((StateModel)stateModel).IncludeMediaPlayer)
{
<script src=/javascript/mediaelement-and-player.min.js></script>
<script src=/javascript/mediaelement-configuration.js></script>
}
<script src=/javascript/mediaelement-and-player.min.js></script>
<script src=/javascript/mediaelement-configuration.js></script>
}
}

@section Head {
@if (ViewData.TryGetValue("StateModel", out var stateModel))
@if (ViewData.TryGetValue("StateModel", out var stateModel) && ((StateModel)stateModel).IncludeMediaPlayer)
{
if (((StateModel)stateModel).IncludeMediaPlayer)
{
<link href="/css/mediaelement-player.min.css" rel="stylesheet" />
}

<link href="/css/mediaelement-player.min.css" rel="stylesheet" />
}
}

0 comments on commit aaf70c7

Please sign in to comment.