mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 09:42:21 -04:00
Midori 0.4.3 support
This commit is contained in:
parent
cc0907fcd7
commit
6bb4db3842
3 changed files with 15 additions and 14 deletions
11
js/module.js
11
js/module.js
|
@ -81,15 +81,16 @@ var Module = Class.extend({
|
|||
* return DomObject | Promise - The dom or a promise with the dom to display.
|
||||
*/
|
||||
getDom: function () {
|
||||
return new Promise((resolve) => {
|
||||
var self = this;
|
||||
return new Promise(function(resolve) {
|
||||
var div = document.createElement("div");
|
||||
var template = this.getTemplate();
|
||||
var templateData = this.getTemplateData();
|
||||
var template = self.getTemplate();
|
||||
var templateData = self.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
|
||||
this.nunjucksEnvironment().render(template, templateData, function (err, res) {
|
||||
self.nunjucksEnvironment().render(template, templateData, function (err, res) {
|
||||
if (err) {
|
||||
Log.error(err)
|
||||
}
|
||||
|
@ -100,7 +101,7 @@ var Module = Class.extend({
|
|||
});
|
||||
} else {
|
||||
// the template is a template string.
|
||||
div.innerHTML = this.nunjucksEnvironment().renderString(template, templateData);
|
||||
div.innerHTML = self.nunjucksEnvironment().renderString(template, templateData);
|
||||
|
||||
resolve(div);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue