Skip to content

Commit

Permalink
Display 'Untitled Calendar' in dashlet title bar if iCal feed does no…
Browse files Browse the repository at this point in the history
…t specify a title or a description

git-svn-id: https://share-extras.googlecode.com/svn/trunk/iCal Feed Dashlet@1272 a3f5c567-fd0f-3a89-9b71-a290c5a5f590
  • Loading branch information
wabson committed Aug 9, 2012
1 parent 9c5fd7f commit 19a2ff3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
label.title=iCalendar Feed
label.title-feed={0}
label.untitled=Untitled Calendar
msg.not-configured=No Feed URL has been specified
msg.error=An error occurred while attempting to fetch the iCal feed
msg.no-events=No upcoming events were found
Expand Down
6 changes: 4 additions & 2 deletions source/web/components/dashlets/ical-feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@
*/
onLoadSuccess: function ICalFeed_onLoadSuccess(p_response)
{
this.titleContainer.innerHTML = this.msg("label.title-feed", p_response.json.calendar.name != "" ? p_response.json.calendar.name : p_response.json.calendar.description);
var events = p_response.json.events, event, lastEvent, isSameDay;
var events = p_response.json.events, event, lastEvent, isSameDay,
calTitle = p_response.json.calendar.name != "" ? p_response.json.calendar.name : p_response.json.calendar.description;

this.titleContainer.innerHTML = calTitle != "" ? this.msg("label.title-feed", calTitle) : this.msg("label.untitled");
if (events.length > 0)
{
// Parse the dates and sort
Expand Down

0 comments on commit 19a2ff3

Please sign in to comment.