Commit 29d93f0b authored by dpapad's avatar dpapad Committed by Commit Bot

WebUI Polymer 2: Update Polymer.Templatizer usage in settings-idle-load.

Need to override |_forwardHostPropV2| method for Polymer 2. |_forwardParentProp|
and |_forwardParentPath| can be removed after Polymer 2 migration is done.

Bug: 849788
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Ic77854582a5184fa41fe5dca02724c9f2cc7dc7d
Reviewed-on: https://chromium-review.googlesource.com/1091653Reviewed-by: default avatarHector Carmona <hcarmona@chromium.org>
Commit-Queue: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565470}
parent 9f95184b
......@@ -24,6 +24,9 @@ Polymer({
/** @private {?Element} */
child_: null,
/** @private {?Element} */
instance_: null,
/** @private {number} */
idleCallback_: 0,
......@@ -52,12 +55,12 @@ Polymer({
this.templatize(this.getContentChildren()[0]);
assert(this.ctor);
const instance = this.stamp({});
this.instance_ = this.stamp({});
assert(!this.child_);
this.child_ = instance.root.firstElementChild;
this.child_ = this.instance_.root.firstElementChild;
this.parentNode.insertBefore(instance.root, this);
this.parentNode.insertBefore(this.instance_.root, this);
resolve(this.child_);
this.fire('lazy-loaded');
......@@ -68,6 +71,7 @@ Polymer({
},
/**
* TODO(dpapad): Delete this method once migration to Polymer 2 has finished.
* @param {string} prop
* @param {Object} value
*/
......@@ -77,11 +81,21 @@ Polymer({
},
/**
* TODO(dpapad): Delete this method once migration to Polymer 2 has finished.
* @param {string} path
* @param {Object} value
*/
_forwardParentPath: function(path, value) {
if (this.child_)
this.child_._templateInstance.notifyPath(path, value, true);
}
},
/**
* @param {string} prop
* @param {Object} value
*/
_forwardHostPropV2: function(prop, value) {
if (this.instance_)
this.instance_.forwardHostProp(prop, value);
},
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment