Skip to content

Commit 6bbbb85

Browse files
committed
Adds new features
* start-opened (#28) * toggle-when-away
1 parent cba8331 commit 6bbbb85

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ And
4646
| `actions` | Array | <b>[Details bellow](https://github.com/PygmySlowLoris/vue-fab/#actions)</b>
4747
| `fixed-tooltip` | Boolean | <b>Default 'false'</b><br> if true, it shows the tooltip beside the actions
4848
| `enable-rotation` | Boolean | <b>Default 'true'</b><br> if true, the fab will rotate to indicate that it has been opened. Will not rotate if there are no actions specified.
49+
| `start-opened` | Boolean | <b>Default 'false'</b><br> if true, the fab will start opened.
50+
| `toggle-when-away` | Boolean | <b>Default 'true'</b><br> if false, the fab will not be closed when clicking outside from the fab component.
4951

5052
### actions
5153

src/FAB.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
directives: {Ripple, tooltip: VTooltip},
8181
data() {
8282
return {
83-
toggle: false,
83+
toggle: this.startOpened,
8484
pos: {},
8585
tooltipPosition: 'left'
8686
}
@@ -121,7 +121,13 @@
121121
},
122122
actions: {
123123
default: () => []
124-
}
124+
},
125+
startOpened: {
126+
default: false
127+
},
128+
toggleWhenAway: {
129+
default: true
130+
},
125131
},
126132
computed: {
127133
actionIconSize() {
@@ -232,7 +238,9 @@
232238
this.toggle = false;
233239
},
234240
away() {
235-
this.toggle = false;
241+
if(this.toggleWhenAway) {
242+
this.toggle = false;
243+
}
236244
},
237245
setPosition() {
238246
this.pos = {};

0 commit comments

Comments
 (0)