mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 04:45:17 +00:00
Introduce new function for location title shortening.
This commit is contained in:
@@ -389,7 +389,7 @@ Module.register("calendar", {
|
||||
var descCell = document.createElement("td");
|
||||
descCell.className = "location";
|
||||
descCell.colSpan = "2";
|
||||
descCell.innerHTML = this.titleTransform(event.location);
|
||||
descCell.innerHTML = this.locationTitleShorten(event.location);
|
||||
locationRow.appendChild(descCell);
|
||||
|
||||
wrapper.appendChild(locationRow);
|
||||
@@ -736,6 +736,19 @@ Module.register("calendar", {
|
||||
return title;
|
||||
},
|
||||
|
||||
/*
|
||||
* locationTitleShorten(title)
|
||||
* Shortens the event location title based on config.maxTitleLength and config.wrapEvents
|
||||
*
|
||||
* argument title string - the event location title to shorten
|
||||
*
|
||||
* return string - The shortened title.
|
||||
*/
|
||||
locationTitleShorten: function (title) {
|
||||
title = this.shorten(title, this.config.maxTitleLength, this.config.wrapEvents, this.config.maxTitleLines);
|
||||
return title;
|
||||
},
|
||||
|
||||
/* broadcastEvents()
|
||||
* Broadcasts the events to all other modules for reuse.
|
||||
* The all events available in one array, sorted on startdate.
|
||||
|
Reference in New Issue
Block a user