Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: third_party/polymer/v0_8/components-chromium/iron-icon/iron-icon-extracted.js

Issue 1082403004: Import Polymer 0.8 and several key elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also remove polymer/explainer Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/v0_8/components-chromium/iron-icon/iron-icon-extracted.js
diff --git a/third_party/polymer/v0_8/components-chromium/iron-icon/iron-icon-extracted.js b/third_party/polymer/v0_8/components-chromium/iron-icon/iron-icon-extracted.js
new file mode 100644
index 0000000000000000000000000000000000000000..0ed3463b6f0d03285a33a149bed35762bdd7ca4b
--- /dev/null
+++ b/third_party/polymer/v0_8/components-chromium/iron-icon/iron-icon-extracted.js
@@ -0,0 +1,68 @@
+
+
+ Polymer({
+
+ is: 'iron-icon',
+
+ properties: {
+
+ icon: {
+ type: String,
+ //value: '',
+ observer: '_iconChanged'
+ },
+
+ theme: {
+ type: String,
+ //value: '',
+ observer: '_updateIcon'
+ },
+
+ src: {
+ type: String,
+ //value: '',
+ observer: '_srcChanged'
+ }
+
+ },
+
+ _DEFAULT_ICONSET: 'icons',
+
+ _iconChanged: function(icon) {
+ var parts = (icon || '').split(':');
+ this._iconName = parts.pop();
+ this._iconsetName = parts.pop() || this._DEFAULT_ICONSET;
+ this._updateIcon();
+ },
+
+ _srcChanged: function(src) {
+ this._updateIcon();
+ },
+
+ _usesIconset: function() {
+ return this.icon || !this.src;
+ },
+
+ _updateIcon: function() {
+ if (this._usesIconset()) {
+ this._iconset = this.$.meta.byKey(this._iconsetName);
+ if (this._iconset) {
+ this._iconset.applyIcon(this, this._iconName, this.theme);
+ } else {
+ console.warn('iron-icon: could not find iconset `'
+ + this._iconsetName + '`, did you import the iconset?');
+ }
+ } else {
+ //if (this._iconset) {
+ // this._iconset.removeIcon(this.root);
+ //}
+ if (!this._img) {
+ this._img = document.createElement('img');
+ }
+ this._img.src = this.src;
+ Polymer.dom(this.root).appendChild(this._img);
+ }
+ }
+
+ });
+

Powered by Google App Engine
This is Rietveld 408576698