Skip to content

Commit

Permalink
Fix JS error if saving unselected calendar.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Feb 25, 2015
1 parent 3954931 commit 107c1d7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions kronolith/js/kronolith.js
Expand Up @@ -3793,7 +3793,8 @@ KronolithCore = {
var color = {
backgroundColor: cal.bg,
color: cal.fg
};
},
legendSpan;
id = data.calendar;
this.getCalendarList(type, cal.owner).select('div').each(function(element) {
if (element.retrieve('calendar') == id) {
Expand All @@ -3809,10 +3810,14 @@ KronolithCore = {
el.setStyle(color);
}
});
$('kronolith-legend').select('span').find(function(span) {
return span.retrieve('calendarclass') == type &&
span.retrieve('calendar') == id;
}).setStyle(color).update(cal.name.escapeHTML());
legendSpan = $('kronolith-legend').select('span')
.find(function(span) {
return span.retrieve('calendarclass') == type &&
span.retrieve('calendar') == id;
});
if (legendSpan) {
legendSpan.setStyle(color).update(cal.name.escapeHTML());
}
Kronolith.conf.calendars[type][id] = cal;
} else {
id = r.id;
Expand Down

0 comments on commit 107c1d7

Please sign in to comment.