瀏覽代碼

template location was ignored if html was defined
also if html was empty

Raanan Weber 7 年之前
父節點
當前提交
d9fa9130ff
共有 2 個文件被更改,包括 5 次插入1 次删除
  1. 4 0
      Viewer/src/configuration/mappers.ts
  2. 1 1
      Viewer/src/templating/templateManager.ts

+ 4 - 0
Viewer/src/configuration/mappers.ts

@@ -52,6 +52,10 @@ class HTMLMapper implements IMapper {
                         val = true;
                     } else if (val === "false") {
                         val = false;
+                    } else if (val === "undefeind") {
+                        val = undefined;
+                    } else if (val === "null") {
+                        val = null;
                     } else {
                         var isnum = !isNaN(parseFloat(val)) && isFinite(val);///^\d+$/.test(val);
                         if (isnum) {

+ 1 - 1
Viewer/src/templating/templateManager.ts

@@ -530,7 +530,7 @@ export class Template {
     private _getTemplateAsHtml(templateConfig: ITemplateConfiguration): Promise<string> {
         if (!templateConfig) {
             return Promise.reject('No templateConfig provided');
-        } else if (templateConfig.html !== undefined) {
+        } else if (templateConfig.html) {
             return Promise.resolve(templateConfig.html);
         } else {
             let location = this._getTemplateLocation(templateConfig);