Commit 3718f456 authored by Noel Gordon's avatar Noel Gordon Committed by Commit Bot

[filesapp] Directly create activity complete element <iron-icon>

No need to invoke the HTML parser from a template, when we can create
the <icon-icon> directly using DOM createElement.

Bug: 1026943
Fixed: 1026943
Change-Id: I2d026ac135310eb6cc4e997e5e9ffb0987f88cd0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1942676Reviewed-by: default avatarAlex Danilo <adanilo@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#720377}
parent b7e36411
......@@ -8,18 +8,10 @@
class ActivityComplete extends HTMLElement {
constructor() {
super();
const host = document.createElement('template');
host.innerHTML = this.constructor.template_;
this.attachShadow({mode: 'open'}).appendChild(host.content.cloneNode(true));
}
/**
* Returns the custom element template content.
* @return {string}
* @private
*/
static get template_() {
return `<iron-icon style='width: 36px; height: 36px;'></icon-icon>`;
const icon = document.createElement('iron-icon');
icon.setAttribute('style', 'width: 36px; height: 36px;');
this.attachShadow({mode: 'open'}).appendChild(icon);
}
/**
......@@ -43,4 +35,4 @@ class ActivityComplete extends HTMLElement {
}
}
window.customElements.define('xf-activity-complete', ActivityComplete);
customElements.define('xf-activity-complete', ActivityComplete);
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