-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmd-icon-badge.html
47 lines (39 loc) · 967 Bytes
/
md-icon-badge.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<link rel="import" href="../polymer/polymer.html">
<dom-module id="md-icon-badge">
<template>
<md-badge id="mdBadge"></md-badge>
<iron-icon icon="[[icon" id="icon"></iron-icon>
<content></content>
</template>
</dom-module>
<script>
Polymer({
is: 'md-icon-badge',
properties:{
text:{
type:String,
value:null
},
icon:{
type:String,
value:null
}
},
ready:function(){
this._setText();
this._setIcon();
},
_setText:function(){
if(this.text){
var badge=this.$.mdBadge;
badge.innerHTML(this.text);
}
},
_setIcon:function(){
if(!this.icon){
var icon=this.$.icon;
icon.style.display='none';
}
}
});
</script>