mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Added option to calendar module that colors only the symbol instead of the whole line
This commit is contained in:
parent
05ef68e079
commit
8053256203
@ -10,6 +10,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
- Enabled translation of feelsLike for module currentweather
|
||||
- Added support for on-going calendar events
|
||||
- Added option to calendar module that colors only the symbol instead of the whole line
|
||||
|
||||
### Changed
|
||||
- Use Electron 2 Beta. **Please test!**
|
||||
|
@ -53,11 +53,13 @@ The following properties can be configured:
|
||||
|
||||
The `calendars` property contains an array of the configured calendars.
|
||||
The `colored` property gives the option for an individual color for each calendar.
|
||||
The `coloredSymbolOnly` property will apply color to the symbol only, not the whole line. This is only applicable when `colored` is also enabled.
|
||||
|
||||
#### Default value:
|
||||
````javascript
|
||||
config: {
|
||||
colored: false,
|
||||
coloredSymbolOnly: false,
|
||||
calendars: [
|
||||
{
|
||||
url: 'http://www.calendarlabs.com/templates/ical/US-Holidays.ics',
|
||||
|
@ -31,6 +31,7 @@ Module.register("calendar", {
|
||||
hidePrivate: false,
|
||||
hideOngoing: false,
|
||||
colored: false,
|
||||
coloredSymbolOnly: false,
|
||||
calendars: [
|
||||
{
|
||||
symbol: "calendar",
|
||||
@ -135,7 +136,7 @@ Module.register("calendar", {
|
||||
var event = events[e];
|
||||
var eventWrapper = document.createElement("tr");
|
||||
|
||||
if (this.config.colored) {
|
||||
if (this.config.colored && !this.config.coloredSymbolOnly) {
|
||||
eventWrapper.style.cssText = "color:" + this.colorForUrl(event.url);
|
||||
}
|
||||
|
||||
@ -143,6 +144,11 @@ Module.register("calendar", {
|
||||
|
||||
if (this.config.displaySymbol) {
|
||||
var symbolWrapper = document.createElement("td");
|
||||
|
||||
if (this.config.colored && this.config.coloredSymbolOnly) {
|
||||
symbolWrapper.style.cssText = "color:" + this.colorForUrl(event.ulr);
|
||||
}
|
||||
|
||||
symbolWrapper.className = "symbol align-right";
|
||||
var symbols = this.symbolsForUrl(event.url);
|
||||
if(typeof symbols === "string") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user