Skip to content

Commit

Permalink
Fix regarding issue #11
Browse files Browse the repository at this point in the history
- Evaluate again inside timeout if toggle is false or true to assure
that tooltips are only shown when  actions are displayed.
- Rolledback to v-show and removed else statement on showTooltip mehotd.
- No need to hide tooltips because will be destroyed by v-if when element
is removed from dom.
- Added 100ms for avoiding delay issues and match animation transition
time of 0.7s (maybe more time is needed)
  • Loading branch information
hazzo committed Sep 29, 2017
1 parent 19bfd53 commit b082d85
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
6 changes: 3 additions & 3 deletions dist/build.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/build.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-fab",
"version": "2.1.0",
"version": "2.1.1",
"description": "Vue Floating Action Button",
"main": "src/index.js",
"repository": {
Expand Down
12 changes: 5 additions & 7 deletions src/FAB.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
leave-active-class="animated quick zoomOut"
>
<template v-if="action.tooltip">
<li v-show="toggle" :style="{ 'background-color': action.color || bgColor }"
<li v-if="toggle" :style="{ 'background-color': action.color || bgColor }"
v-tooltip="{ content: action.tooltip, placement: tooltipPosition, classes: 'fab-tooltip', trigger: tooltipTrigger}"
@click="toParent(action.name)" class="pointer"
ref="actions">
Expand Down Expand Up @@ -266,14 +266,12 @@
//timeout to prevent wrong position for the tooltip
setTimeout(() => {
this.$refs.actions.forEach((item) => {
item._tooltip.show();
if(this.toggle) {
item._tooltip.show();
}
});
},600);
},700);
}else{
this.$refs.actions.forEach((item) => {
item._tooltip.hide();
});
}
}
},
Expand Down

0 comments on commit b082d85

Please sign in to comment.