Index: ui/webui/resources/cr_elements/cr_lazy_render/cr_lazy_render.js |
diff --git a/ui/webui/resources/cr_elements/cr_lazy_render/cr_lazy_render.js b/ui/webui/resources/cr_elements/cr_lazy_render/cr_lazy_render.js |
index b7c58f7d4980de51c97eb028e3be72dd36ff784a..627505a4364e888cc6ab730152247caeed1afb36 100644 |
--- a/ui/webui/resources/cr_elements/cr_lazy_render/cr_lazy_render.js |
+++ b/ui/webui/resources/cr_elements/cr_lazy_render/cr_lazy_render.js |
@@ -11,9 +11,7 @@ |
* <heavy-menu></heavy-menu> |
* </template> |
* |
- * this.$.menu.get().then(function(menu) { |
- * menu.show(); |
- * }); |
+ * this.$.menu.get().show(); |
*/ |
Polymer({ |
@@ -24,28 +22,17 @@ Polymer({ |
Polymer.Templatizer |
], |
- /** @private {Promise<Element>} */ |
- renderPromise_: null, |
- |
/** @private {TemplatizerNode} */ |
child_: null, |
/** |
- * Stamp the template into the DOM tree asynchronously |
- * @return {Promise<Element>} Promise which resolves when the template has |
- * been stamped. |
+ * Stamp the template into the DOM tree synchronously |
+ * @return {Element} Child element which has been stamped into the DOM tree. |
*/ |
get: function() { |
- if (!this.renderPromise_) { |
- this.renderPromise_ = new Promise(function(resolve) { |
- this._debounceTemplate(function() { |
- this.render_(); |
- this.renderPromise_ = null; |
- resolve(this.getIfExists()); |
- }.bind(this)); |
- }.bind(this)); |
- } |
- return this.renderPromise_; |
+ if (!this.child_) |
+ this.render_(); |
+ return this.child_; |
}, |
/** |