mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 11:50:00 +00:00
Fix linter errors
This commit is contained in:
parent
e2df5739f0
commit
be3d703692
12
js/main.js
12
js/main.js
@ -95,22 +95,22 @@ var MM = (function() {
|
||||
*
|
||||
* argument module Module - The module that needs an update.
|
||||
* argument speed Number - The number of microseconds for the animation. (optional)
|
||||
*
|
||||
*
|
||||
* return Promise - Resolved when the dom is fully updated.
|
||||
*/
|
||||
var updateDom = function(module, speed) {
|
||||
return new Promise((resolve) => {
|
||||
var newContentPromise = module.getDom();
|
||||
var newHeader = module.getHeader();
|
||||
|
||||
|
||||
if (!(newContentPromise instanceof Promise)) {
|
||||
// convert to a promise if not already one to avoid if/else's everywhere
|
||||
newContentPromise = Promise.resolve(newContentPromise);
|
||||
}
|
||||
|
||||
|
||||
newContentPromise.then((newContent) => {
|
||||
var updatePromise = updateDomWithContent(module, speed, newHeader, newContent);
|
||||
|
||||
|
||||
updatePromise.then(resolve).catch(Log.error);
|
||||
}).catch(Log.error);
|
||||
});
|
||||
@ -118,12 +118,12 @@ var MM = (function() {
|
||||
|
||||
/* updateDomWithContent(module, speed, newHeader, newContent)
|
||||
* Update the dom with the specified content
|
||||
*
|
||||
*
|
||||
* argument module Module - The module that needs an update.
|
||||
* argument speed Number - The number of microseconds for the animation. (optional)
|
||||
* argument newHeader String - The new header that is generated.
|
||||
* argument newContent Domobject - The new content that is generated.
|
||||
*
|
||||
*
|
||||
* return Promise - Resolved when the module dom has been updated.
|
||||
*/
|
||||
var updateDomWithContent = function(module, speed, newHeader, newContent) {
|
||||
|
@ -85,7 +85,7 @@ var Module = Class.extend({
|
||||
var div = document.createElement("div");
|
||||
var template = this.getTemplate();
|
||||
var templateData = this.getTemplateData();
|
||||
|
||||
|
||||
// Check to see if we need to render a template string or a file.
|
||||
if (/^.*((\.html)|(\.njk))$/.test(template)) {
|
||||
// the template is a filename
|
||||
|
Loading…
x
Reference in New Issue
Block a user