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 |
index 16d849df12dbaf5e8b06136962601b18b8851ff0..0f1add2736429dde45d555f770d1742aaa0d136e 100644 |
--- 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 |
@@ -1,66 +1,79 @@ |
- Polymer({ |
- |
- is: 'iron-icon', |
- |
- enableCustomStyleProperties: true, |
+ Polymer({ |
+ |
+ is: 'iron-icon', |
+ |
+ properties: { |
+ |
+ /** |
+ * The name of the icon to use. The name should be of the form: |
+ * `iconset_name:icon_name`. |
+ */ |
+ icon: { |
+ type: String, |
+ observer: '_iconChanged' |
+ }, |
+ |
+ /** |
+ * The name of the theme to used, if one is specified by the |
+ * iconset. |
+ */ |
+ theme: { |
+ type: String, |
+ observer: '_updateIcon' |
+ }, |
+ |
+ /** |
+ * If using iron-icon without an iconset, you can set the src to be |
+ * the URL of an individual icon image file. Note that this will take |
+ * precedence over a given icon attribute. |
+ */ |
+ src: { |
+ type: String, |
+ observer: '_srcChanged' |
+ } |
+ }, |
- properties: { |
+ _DEFAULT_ICONSET: 'icons', |
- icon: { |
- type: String, |
- observer: '_iconChanged' |
+ _iconChanged: function(icon) { |
+ var parts = (icon || '').split(':'); |
+ this._iconName = parts.pop(); |
+ this._iconsetName = parts.pop() || this._DEFAULT_ICONSET; |
+ this._updateIcon(); |
}, |
- theme: { |
- type: String, |
- observer: '_updateIcon' |
+ _srcChanged: function(src) { |
+ this._updateIcon(); |
}, |
- src: { |
- type: String, |
- 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; |
- }, |
+ _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); |
+ _updateIcon: function() { |
+ if (this._usesIconset()) { |
+ if (this._iconsetName) { |
+ this._iconset = this.$.meta.byKey(this._iconsetName); |
+ if (this._iconset) { |
+ this._iconset.applyIcon(this, this._iconName, this.theme); |
+ } else { |
+ this._warn(this._logf('_updateIcon', 'could not find iconset `' |
+ + this._iconsetName + '`, did you import the iconset?')); |
+ } |
+ } |
} else { |
- console.warn('iron-icon: could not find iconset `' |
- + this._iconsetName + '`, did you import the iconset?'); |
- } |
- } else { |
- if (!this._img) { |
- this._img = document.createElement('img'); |
- this._img.style.width = '100%'; |
- this._img.style.height = '100%'; |
+ if (!this._img) { |
+ this._img = document.createElement('img'); |
+ this._img.style.width = '100%'; |
+ this._img.style.height = '100%'; |
+ } |
+ this._img.src = this.src; |
+ Polymer.dom(this.root).appendChild(this._img); |
} |
- this._img.src = this.src; |
- Polymer.dom(this.root).appendChild(this._img); |
} |
- } |
- }); |
+ }); |
+ |