Skip to content

Commit

Permalink
Agent: Load expanded text outside text column GH-123
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-yagodin committed Oct 8, 2020
1 parent 8ccdc8a commit 8a8ed0d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
3 changes: 2 additions & 1 deletion R7.News.Agent/ViewAgent.ascx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</div>
</LayoutTemplate>
<ItemTemplate>
<div>
<div class="news-entry">
<h3 class='<%# (Item.IsOnlyEntry ? "d-none" : "") %>'><%# HttpUtility.HtmlDecode (Item.TitleLink) %></h3>
<p>
<news:TermLinks id="termLinks" runat="server" CssClass="list-inline term-links" />
Expand Down Expand Up @@ -54,6 +54,7 @@
ShowExpandTextAction="true" />
</div>
</div>
<div class="news-entry-expanded-text"></div>
</div>
</ItemTemplate>
<ItemSeparatorTemplate>
Expand Down
10 changes: 4 additions & 6 deletions R7.News.Stream/ViewNewsEntry.ascx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<%@ Import Namespace="System.Web" %>

<dnn:DnnCssInclude runat="server" FilePath="~/DesktopModules/R7.News/R7.News/assets/css/module.css" />
<div class="news-module news-entry">
<div class="news-module news-entry-single">
<asp:FormView id="formNewsEntry" runat="server" RenderOuterTable="false"
ItemType="R7.News.Stream.ViewModels.NewsEntryViewModel" OnDataBound="formNewsEntry_DataBound">
<ItemTemplate>
<div>
<div class="news-entry">
<h3><%# HttpUtility.HtmlDecode (Item.TitleLink) %></h3>
<p>
<news:TermLinks id="termLinks" runat="server" CssClass="list-inline term-links" />
Expand Down Expand Up @@ -38,10 +38,8 @@
ShowExpandTextAction="false" />
</div>
</div>
<div class="row">
<div class="col">
<%# HttpUtility.HtmlDecode (Item.Text) %>
</div>
<div class="news-entry-expanded-text">
<%# HttpUtility.HtmlDecode (Item.Text) %>
</div>
</div>
</ItemTemplate>
Expand Down
3 changes: 2 additions & 1 deletion R7.News.Stream/ViewStream.ascx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</div>
</LayoutTemplate>
<ItemTemplate>
<div>
<div class="news-entry">
<h3><%# HttpUtility.HtmlDecode (Item.TitleLink) %></h3>
<p>
<news:TermLinks id="termLinks" runat="server" CssClass="list-inline term-links" />
Expand Down Expand Up @@ -54,6 +54,7 @@
ShowExpandTextAction="true" />
</div>
</div>
<div class="news-entry-expanded-text"></div>
</div>
</ItemTemplate>
<ItemSeparatorTemplate>
Expand Down
4 changes: 2 additions & 2 deletions R7.News/assets/js/news.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ r7_news.expandText = function (btn, entryTextId, moduleId) {
var service = new r7_news.service ($, moduleId);
service.getNewsEntryText (
function (data) {
$(btn).parent().parent().prev().append(data.rawText);
$(btn).closest(".news-entry").find(".news-entry-expanded-text").append(data.rawText);
$(btn).parent().hide();
},
function (xhr, status) {
console.error ("R7.News: Error loading text!", xhr);
$(btn).parent().parent().prev().append('<p class="alert alert-danger">' + r7_news.resx ["errorLoadingExpandedText"] + '</p>');
$(btn).closest(".news-entry").find(".news-entry-expanded-text").append('<p class="alert alert-danger">' + r7_news.resx ["errorLoadingExpandedText"] + '</p>');
$(btn).parent().hide();
},
{ entryTextId: entryTextId }
Expand Down

0 comments on commit 8a8ed0d

Please sign in to comment.