From 358e2b3ccf7f74238237947a09de54ec26f4373d Mon Sep 17 00:00:00 2001 From: Veeck Date: Fri, 8 Mar 2019 11:25:38 +0100 Subject: [PATCH 1/4] Use getHeader instead of data.header when creating the DOM --- js/main.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/main.js b/js/main.js index 21a882f8..41e90a96 100644 --- a/js/main.js +++ b/js/main.js @@ -39,12 +39,12 @@ var MM = (function() { dom.opacity = 0; wrapper.appendChild(dom); - if (typeof module.data.header !== "undefined" && module.data.header !== "") { + if (typeof module.getHeader() !== "undefined" && module.getHeader() !== "") { var moduleHeader = document.createElement("header"); - moduleHeader.innerHTML = module.data.header; + moduleHeader.innerHTML = module.getHeader(); moduleHeader.className = "module-header"; dom.appendChild(moduleHeader); - } + } var moduleContent = document.createElement("div"); moduleContent.className = "module-content"; From 5dfd8a61be37c152a9a2e97051485d85faf4a1c9 Mon Sep 17 00:00:00 2001 From: Veeck Date: Fri, 8 Mar 2019 11:29:48 +0100 Subject: [PATCH 2/4] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dad485a..b85367df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Fix null dereference in moduleNeedsUpdate when the module isn't visible - Calendar: Fixed event end times by setting default calendarEndTime to "LT" (Local time format). [#1479] - Calendar: Fixed missing calendar fetchers after server process restarts [#1589](https://github.com/MichMich/MagicMirror/issues/1589) +- Use getHeader instead of data.header when creating the DOM so overwriting the function also propagates into it ### New weather module - Fixed weather forecast table display [#1499](https://github.com/MichMich/MagicMirror/issues/1499). From 29ef1db86b0278c5cb87e22b7439e835328a0831 Mon Sep 17 00:00:00 2001 From: Veeck Date: Fri, 8 Mar 2019 11:33:02 +0100 Subject: [PATCH 3/4] Remove whitespace --- js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/main.js b/js/main.js index 41e90a96..2330d3ee 100644 --- a/js/main.js +++ b/js/main.js @@ -44,7 +44,7 @@ var MM = (function() { moduleHeader.innerHTML = module.getHeader(); moduleHeader.className = "module-header"; dom.appendChild(moduleHeader); - } + } var moduleContent = document.createElement("div"); moduleContent.className = "module-content"; From de684dcb63c7d3069213ac28c9339b53b136a325 Mon Sep 17 00:00:00 2001 From: Veeck Date: Fri, 8 Mar 2019 11:19:15 +0100 Subject: [PATCH 4/4] Fix typos in jsdoc --- js/module.js | 4 ++-- modules/default/calendar/calendarfetcher.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/module.js b/js/module.js index 907a7f61..3e39dd5c 100644 --- a/js/module.js +++ b/js/module.js @@ -212,7 +212,7 @@ var Module = Class.extend({ /* setData(data) * Set the module data. * - * argument data obejct - Module data. + * argument data object - Module data. */ setData: function (data) { this.data = data; @@ -226,7 +226,7 @@ var Module = Class.extend({ /* setConfig(config) * Set the module config and combine it with the module defaults. * - * argument config obejct - Module config. + * argument config object - Module config. */ setConfig: function (config) { this.config = Object.assign({}, this.defaults, config); diff --git a/modules/default/calendar/calendarfetcher.js b/modules/default/calendar/calendarfetcher.js index a1e4aa8d..0076a605 100644 --- a/modules/default/calendar/calendarfetcher.js +++ b/modules/default/calendar/calendarfetcher.js @@ -273,7 +273,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri /* isFullDayEvent(event) * Checks if an event is a fullday event. * - * argument event obejct - The event object to check. + * argument event object - The event object to check. * * return bool - The event is a fullday event. */