浏览代码

force template redraw after adding a new button

Raanan Weber 7 年之前
父节点
当前提交
f7113afc67
共有 2 个文件被更改,包括 6 次插入1 次删除
  1. 4 0
      Viewer/src/templating/templateManager.ts
  2. 2 1
      Viewer/src/viewer/defaultViewer.ts

+ 4 - 0
Viewer/src/templating/templateManager.ts

@@ -379,6 +379,10 @@ export class Template {
         }
     }
 
+    public redraw() {
+        this.updateParams({});
+    }
+
     /**
      * Get the template'S configuration
      */

+ 2 - 1
Viewer/src/viewer/defaultViewer.ts

@@ -57,8 +57,9 @@ export class DefaultViewer extends AbstractViewer {
         }
         if (plugin.addHTMLTemplate) {
             template.onHTMLRendered.add((tmpl) => {
-                plugin.addHTMLTemplate && plugin.addHTMLTemplate(tmpl);
+                plugin.addHTMLTemplate!(tmpl);
             });
+            template.redraw();
         }
 
         if (plugin.eventsToAttach) {