Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.

Commit 2f2a3fa

Browse files
committed
icon size change updates icon.
1 parent edecced commit 2f2a3fa

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

core-icon.html

+8-7
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,17 @@
7979
*/
8080
icon: '',
8181

82+
observe: {
83+
'size icon': 'updateIcon'
84+
},
85+
8286
defaultIconset: 'icons',
8387

8488
ready: function() {
8589
if (!meta) {
8690
meta = document.createElement('core-iconset');
8791
}
88-
this.sizeChanged();
89-
},
90-
91-
sizeChanged: function() {
92-
this.style.width = this.style.height = this.size + 'px';
92+
this.updateIcon();
9393
},
9494

9595
srcChanged: function() {
@@ -102,14 +102,15 @@
102102
return meta.byId(name || this.defaultIconset);
103103
},
104104

105-
iconChanged: function() {
105+
updateIcon: function() {
106+
this.style.width = this.style.height = this.size + 'px';
106107
if (this.icon) {
107108
var parts = String(this.icon).split(':');
108109
var icon = parts.pop();
109110
if (icon) {
110111
var set = this.getIconset(parts.pop());
111112
if (set) {
112-
set.applyIcon(this, icon, this.activeTheme, this.size / set.iconSize);
113+
set.applyIcon(this, icon, this.size / set.iconSize);
113114
}
114115
}
115116
}

0 commit comments

Comments
 (0)