From 9e828b14773205622cdee97d3f53d04be417414e Mon Sep 17 00:00:00 2001 From: Carlo Teo Pedretti Date: Wed, 11 May 2022 09:04:58 +0200 Subject: [PATCH] added mouseclick option for pb-highlight --- src/pb-highlight.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/pb-highlight.js b/src/pb-highlight.js index c3b02209..5e9ba316 100644 --- a/src/pb-highlight.js +++ b/src/pb-highlight.js @@ -47,6 +47,9 @@ export class PbHighlight extends pbMixin(LitElement) { type: Boolean, attribute: 'highlight-self' }, + click: { + type: Boolean + }, _className: { type: String } @@ -59,6 +62,7 @@ export class PbHighlight extends pbMixin(LitElement) { this.duration = 0; this.scroll = false; this.highlightSelf = false; + this.click = false; this._className = 'highlight-off'; } @@ -75,7 +79,7 @@ export class PbHighlight extends pbMixin(LitElement) { } } - _mouseOver() { + _mouseInteraction() { this.emitTo('pb-highlight-off', { source: this }); @@ -93,7 +97,11 @@ export class PbHighlight extends pbMixin(LitElement) { if (this.disabled) { return html``; } - return html``; + if (this.click) { + return html``; + } else { + return html``; + } } static get styles() {