forked from dreammmr/paper-fab-menu
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpaper-fab-menu-item.html
61 lines (58 loc) · 1.7 KB
/
paper-fab-menu-item.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<dom-module id="paper-fab-menu-item">
<template>
<style is="custom-style">
:host .menu-item {
position : relative;
}
:host {
flex : 1;
margin : 7px;
}
:host .menu-item paper-fab ::content .fa {
transform: rotate(0deg) !important;
}
:host .menu-item {
transform : scale(0);
}
:host paper-button {
border-radius: 50%;
width: 35px;
height: 35px;
font-size: 15pt;
min-width: 0px;
color: white;
}
</style>
<div class="menu-item">
<paper-button raised id="paperFab">
<span id='iconContent'></span>
</paper-button>
<paper-tooltip offset="10" margin-top="0" position="{{ tooltipPosition }}">{{ label }}</paper-tooltip>
</div>
</template>
<script>
Polymer({
is : 'paper-fab-menu-item',
properties : {
color : {
type : 'String'
},
icon: {
type: String
},
tooltipPosition: {
type: 'String',
value: 'left'
}
},
attached: function () {
this.$.iconContent.classList.add('fa', this.icon);
},
ready : function() {
if(this.color) {
this.$.paperFab.style.backgroundColor = this.color;
}
}
});
</script>
</dom-module>