From eef97808a7b42acc2aeb7c7bbdb0f82e4833645a Mon Sep 17 00:00:00 2001 From: Jess Stopa Date: Fri, 27 Jul 2018 13:50:18 +0200 Subject: [PATCH 1/3] Added option for delay on mouseover --- src/component/popper.js.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/component/popper.js.vue b/src/component/popper.js.vue index 5ca7eed..d101231 100644 --- a/src/component/popper.js.vue +++ b/src/component/popper.js.vue @@ -113,6 +113,10 @@ default: 'hover', validator: value => ['click', 'hover'].indexOf(value) > -1 }, + delayOnMouseOver: { + type: Number, + default: 10, + }, delayOnMouseOut: { type: Number, default: 10, @@ -302,8 +306,10 @@ }, onMouseOver() { - this.showPopper = true; clearTimeout(this._timer); + this._timer = setTimeout(() => { + this.showPopper = true; + }, this.delayOnMouseOver); }, onMouseOut() { From d9b0b34c49e4c78027b2b4e326785d7796f85808 Mon Sep 17 00:00:00 2001 From: Jess Stopa Date: Fri, 27 Jul 2018 13:51:49 +0200 Subject: [PATCH 2/3] Clear timer on mouseout --- src/component/popper.js.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/component/popper.js.vue b/src/component/popper.js.vue index d101231..61eddc1 100644 --- a/src/component/popper.js.vue +++ b/src/component/popper.js.vue @@ -313,6 +313,7 @@ }, onMouseOut() { + clearTimeout(this._timer); this._timer = setTimeout(() => { this.showPopper = false; }, this.delayOnMouseOut); From 6e2a5e61395cf2b5ac172e566c6f4b18920a4d06 Mon Sep 17 00:00:00 2001 From: Jess Stopa Date: Mon, 30 Jul 2018 11:01:57 +0200 Subject: [PATCH 3/3] Updated readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index dac083b..a6723ca 100644 --- a/README.md +++ b/README.md @@ -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 | |