Skip to content

Commit

Permalink
Revert "Add category indicator to calendar-grid"
Browse files Browse the repository at this point in the history
This reverts commit d71a70e.
  • Loading branch information
georgehrke committed Oct 24, 2019
1 parent d71a70e commit 5b39aaf
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 56 deletions.
27 changes: 0 additions & 27 deletions css/fullcalendar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -152,30 +152,3 @@
.fc * {
box-sizing: content-box !important;
}

.fc-content {
display: flex;
align-items: center;
width: 100%;

.fc-time {
flex-shrink: 0;
}

.fc-title {
flex-shrink: 1;
overflow: hidden;
text-overflow: ellipsis;
}

.fc-nc-categories {
flex-shrink: 0;
width: 16px;
height: 16px;
font-size: 0.95em;
text-align: center;
display: block;
border-radius: 50%;
margin-left: auto;
}
}
24 changes: 0 additions & 24 deletions src/fullcalendar/eventRender.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
*
*/

import { uidToColor } from '../utils/uidToColor.js'
import { generateTextColorForRGB } from '../utils/color.js'

/**
*
* @param {Object} data The destructuring object
Expand All @@ -32,25 +29,4 @@ import { generateTextColorForRGB } from '../utils/color.js'
export default function({ event, el }) {
el.dataset.objectId = event.extendedProps.objectId
el.dataset.recurrenceId = event.extendedProps.recurrenceId

if (event.extendedProps.firstCategory !== null) {
const categoriesNode = document.createElement('div')
categoriesNode.classList.add('fc-nc-categories')
categoriesNode.innerText = event.extendedProps.firstCategory.substr(0, 1)

const color = uidToColor(event.extendedProps.firstCategory)
const borderColor = `rgb(${color.r},${color.g},${color.b})`
const backgroundColor = `rgba(${color.r},${color.g},${color.b},0.7)`
const textColor = generateTextColorForRGB({
red: color.r,
green: color.g,
blue: color.b
})

categoriesNode.style.borderColor = borderColor
categoriesNode.style.backgroundColor = backgroundColor
categoriesNode.style.color = textColor

el.querySelector('.fc-content').appendChild(categoriesNode)
}
}
6 changes: 1 addition & 5 deletions src/fullcalendar/eventSourceFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ export function eventSourceFunction(calendarObjects, start, end, timezone) {
classNames.push('fc-event-nc-tentative')
}

const categories = Array.from(object.getCategoryIterator())
const firstCategory = categories.length !== 0 ? categories[0] : null

const fcEvent = {
id: [calendarObject.id, object.id].join('###'),
title: object.title || translate('calendar', 'Untitled event'),
Expand All @@ -59,8 +56,7 @@ export function eventSourceFunction(calendarObjects, start, end, timezone) {
extendedProps: {
objectId: calendarObject.id,
recurrenceId: object.getReferenceRecurrenceId().unixTime,
canModifyAllDay: object.canModifyAllDay(),
firstCategory
canModifyAllDay: object.canModifyAllDay()
}
}

Expand Down

0 comments on commit 5b39aaf

Please sign in to comment.