Skip to content

Commit

Permalink
Merge pull request #47 from jezzdk/master
Browse files Browse the repository at this point in the history
Added option for delay on mouseover
  • Loading branch information
RobinCK authored Jul 30, 2018
2 parents 352dc80 + 6e2a5e6 commit 6eeb491
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ npm run build
| Props | Type | Default | Description |
| --------------------|:----------| ------------------------------------------------|--------------|
| disabled | Boolean | false | |
| delay-on-mouse-over | Number | 10 | Delay in ms before showing popper during a mouse over |
| delay-on-mouse-out | Number | 10 | Delay in ms before hiding popper during a mouse out |
| append-to-body | Boolean | false | |
| visible-arrow | Boolean | true | |
Expand Down
9 changes: 8 additions & 1 deletion src/component/popper.js.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@
default: 'hover',
validator: value => ['click', 'hover'].indexOf(value) > -1
},
delayOnMouseOver: {
type: Number,
default: 10,
},
delayOnMouseOut: {
type: Number,
default: 10,
Expand Down Expand Up @@ -302,11 +306,14 @@
},
onMouseOver() {
this.showPopper = true;
clearTimeout(this._timer);
this._timer = setTimeout(() => {
this.showPopper = true;
}, this.delayOnMouseOver);
},
onMouseOut() {
clearTimeout(this._timer);
this._timer = setTimeout(() => {
this.showPopper = false;
}, this.delayOnMouseOut);
Expand Down

0 comments on commit 6eeb491

Please sign in to comment.