MDL-63714 core: Wrap doRender in pendingjs
authorAndrew Nicols <andrew@nicols.co.uk>
Fri, 19 Oct 2018 07:13:37 +0000 (15:13 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Wed, 24 Oct 2018 00:12:10 +0000 (08:12 +0800)
lib/amd/build/templates.min.js
lib/amd/src/templates.js

index f85887e..7df3db3 100644 (file)
Binary files a/lib/amd/build/templates.min.js and b/lib/amd/build/templates.min.js differ
index dd49428..21fbed0 100644 (file)
@@ -509,6 +509,7 @@ define(['core/mustache',
         this.currentThemeName = themeName;
         var iconTemplate = iconSystem.getTemplateName();
 
+        M.util.js_pending('core/templates:doRender');
         return this.getTemplate(iconTemplate).then(function() {
             this.addHelpers(context, themeName);
             var result = mustache.render(templateSource, context, this.partialHelper.bind(this));
@@ -553,7 +554,11 @@ define(['core/mustache',
             }
 
             return $.Deferred().resolve(html, js).promise();
-        }.bind(this));
+        }.bind(this))
+        .then(function(html, js) {
+            M.util.js_complete('core/templates:doRender');
+            return $.Deferred().resolve(html, js).promise();
+        });
     };
 
     /**