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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1
2
3 Polymer({
4
5 is: 'iron-icon',
6
7 properties: {
8
9 icon: {
10 type: String,
11 //value: '',
12 observer: '_iconChanged'
13 },
14
15 theme: {
16 type: String,
17 //value: '',
18 observer: '_updateIcon'
19 },
20
21 src: {
22 type: String,
23 //value: '',
24 observer: '_srcChanged'
25 }
26
27 },
28
29 _DEFAULT_ICONSET: 'icons',
30
31 _iconChanged: function(icon) {
32 var parts = (icon || '').split(':');
33 this._iconName = parts.pop();
34 this._iconsetName = parts.pop() || this._DEFAULT_ICONSET;
35 this._updateIcon();
36 },
37
38 _srcChanged: function(src) {
39 this._updateIcon();
40 },
41
42 _usesIconset: function() {
43 return this.icon || !this.src;
44 },
45
46 _updateIcon: function() {
47 if (this._usesIconset()) {
48 this._iconset = this.$.meta.byKey(this._iconsetName);
49 if (this._iconset) {
50 this._iconset.applyIcon(this, this._iconName, this.theme);
51 } else {
52 console.warn('iron-icon: could not find iconset `'
53 + this._iconsetName + '`, did you import the iconset?');
54 }
55 } else {
56 //if (this._iconset) {
57 // this._iconset.removeIcon(this.root);
58 //}
59 if (!this._img) {
60 this._img = document.createElement('img');
61 }
62 this._img.src = this.src;
63 Polymer.dom(this.root).appendChild(this._img);
64 }
65 }
66
67 });
68
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698