Skip to content

Commit

Permalink
add class option to event icons
Browse files Browse the repository at this point in the history
  • Loading branch information
hajohns committed Apr 22, 2016
1 parent 643c259 commit 7fc5037
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions css/site.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion scripts/Calendar/Contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,12 @@ export interface IEventIcon {
/**
* src url for the icon
*/
src: string;
src?: string;

/**
* css class for the icon
*/
cssClass?: string;

/**
* tooltip for icon
Expand Down
5 changes: 2 additions & 3 deletions scripts/Calendar/EventSources/VSOCapacityEventSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,8 @@ export class VSOCapacityEventSource implements Calendar_Contracts.IEventSource {
category: <Calendar_Contracts.IEventCategory> {
id: "",
title: "Grouped Event",
color: this._categoryColor
},
icons: []
color: this._categoryColor
}
}
eventMap[date] = regroupedEvent;
renderedEvents.push(regroupedEvent);
Expand Down
2 changes: 1 addition & 1 deletion scripts/Calendar/Views.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export class CalendarView extends Controls_Navigation.NavigationView {

if (calendarEvent.icons) {
$.each(calendarEvent.icons, (index: number, icon: Calendar_Contracts.IEventIcon) => {
var $image = $("<img/>").attr("src", icon.src).addClass("event-icon").prependTo(element.find('.fc-content'));
var $image = $("<img/>").attr("src", icon.src).addClass("event-icon").addClass(icon.cssClass).prependTo(element.find('.fc-content'));
if (icon.title) {
$image.attr("title", icon.title);
}
Expand Down

0 comments on commit 7fc5037

Please sign in to comment.