|
37 | 37 | v-tooltip="{ content: mainTooltip, placement: tooltipPosition, classes: 'fab-tooltip' }" |
38 | 38 | class="fab-main pointer" :style="{ 'background-color': bgColor, 'padding': paddingAmount }" |
39 | 39 | > |
40 | | - <i :class="[ mainIconSize , { rotate: toggle } ,'material-icons main']">{{mainIcon}}</i> |
41 | | - <i :class="[ mainIconSize , { rotate: toggle } ,'material-icons close']">add</i> |
| 40 | + <i :class="[ mainIconSize , { rotate: toggle && allowRotation } ,'material-icons main']">{{mainIcon}}</i> |
| 41 | + <i :class="[ mainIconSize , { rotate: toggle && allowRotation } ,'material-icons close']">add</i> |
42 | 42 | </div> |
43 | 43 | </template> |
44 | 44 | <template v-else> |
45 | 45 | <div v-ripple="rippleColor == 'light' ? 'rgba(255, 255, 255, 0.35)' : ''" @click="toggle = !toggle" |
46 | 46 | class="fab-main pointer" :style="{ 'background-color': bgColor, 'padding': paddingAmount }" |
47 | 47 | > |
48 | | - <i :class="[ mainIconSize , { rotate: toggle }, 'material-icons main']">{{mainIcon}}</i> |
49 | | - <i :class="[ mainIconSize , { rotate: toggle }, 'material-icons close']">add</i> |
| 48 | + <i :class="[ mainIconSize , { rotate: toggle && allowRotation }, 'material-icons main']">{{mainIcon}}</i> |
| 49 | + <i :class="[ mainIconSize , { rotate: toggle && allowRotation }, 'material-icons close']">add</i> |
50 | 50 | </div> |
51 | 51 | </template> |
52 | 52 | </template> |
|
55 | 55 | <div v-bind:v-tooltip="{ content: mainTooltip, placement: tooltipPosition, classes: 'fab-tooltip'}" |
56 | 56 | class="fab-main pointer" :style="{ 'background-color': bgColor, 'padding': paddingAmount }" |
57 | 57 | > |
58 | | - <i class="material-icons md-36 main" :class="{ rotate: toggle }">{{mainIcon}}</i> |
59 | | - <i class="material-icons md-36 close" :class="{ rotate: toggle }">add</i> |
| 58 | + <i class="material-icons md-36 main" :class="{ rotate: toggle && allowRotation }">{{mainIcon}}</i> |
| 59 | + <i class="material-icons md-36 close" :class="{ rotate: toggle && allowRotation }">add</i> |
60 | 60 | </div> |
61 | 61 | </template> |
62 | 62 | <template v-else> |
63 | 63 | <div class="fab-main pointer" :style="{ 'background-color': bgColor, 'padding': paddingAmount }" |
64 | 64 | > |
65 | | - <i class="material-icons md-36 main" :class="{ rotate: toggle }">{{mainIcon}}</i> |
66 | | - <i class="material-icons md-36 close" :class="{ rotate: toggle }">add</i> |
| 65 | + <i class="material-icons md-36 main" :class="{ rotate: toggle && allowRotation }">{{mainIcon}}</i> |
| 66 | + <i class="material-icons md-36 close" :class="{ rotate: toggle && allowRotation }">add</i> |
67 | 67 | </div> |
68 | 68 | </template> |
69 | 69 | </template> |
|
116 | 116 | fixedTooltip: { |
117 | 117 | default: false |
118 | 118 | }, |
| 119 | + enableRotation:{ |
| 120 | + default: true |
| 121 | + }, |
119 | 122 | actions: { |
120 | 123 | default: () => [] |
121 | | - } |
| 124 | + } |
122 | 125 | }, |
123 | 126 | computed: { |
124 | 127 | actionIconSize() { |
|
136 | 139 | return 'md-24'; |
137 | 140 | } |
138 | 141 | }, |
| 142 | + allowRotation(){ |
| 143 | + return this.enableRotation && this.actions && this.actions.length; |
| 144 | + }, |
139 | 145 | mainIconSize() { |
140 | 146 | switch (this.iconSize) { |
141 | 147 | case 'small': |
|
0 commit comments