8 * The name of the icon to use. The name should be of the form:
9 * `iconset_name:icon_name`.
13 observer: '_iconChanged'
17 * The name of the theme to used, if one is specified by the
22 observer: '_updateIcon'
26 * If using iron-icon without an iconset, you can set the src to be
27 * the URL of an individual icon image file. Note that this will take
28 * precedence over a given icon attribute.
32 observer: '_srcChanged'
36 value: Polymer.Base.create('iron-meta', {type: 'iconset'})
41 _DEFAULT_ICONSET: 'icons',
43 _iconChanged: function(icon) {
44 var parts = (icon || '').split(':');
45 this._iconName = parts.pop();
46 this._iconsetName = parts.pop() || this._DEFAULT_ICONSET;
50 _srcChanged: function(src) {
54 _usesIconset: function() {
55 return this.icon || !this.src;
58 /** @suppress {visibility} */
59 _updateIcon: function() {
60 if (this._usesIconset()) {
61 if (this._iconsetName) {
62 this._iconset = this._meta.byKey(this._iconsetName);
64 this._iconset.applyIcon(this, this._iconName, this.theme);
66 this._warn(this._logf('_updateIcon', 'could not find iconset `'
67 + this._iconsetName + '`, did you import the iconset?'));
72 this._img = document.createElement('img');
73 this._img.style.width = '100%';
74 this._img.style.height = '100%';
75 this._img.draggable = false;
77 this._img.src = this.src;
78 Polymer.dom(this.root).appendChild(this._img);