diff options
-rw-r--r-- | app/assets/javascripts/feature_highlight/feature_highlight.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/assets/javascripts/feature_highlight/feature_highlight.js b/app/assets/javascripts/feature_highlight/feature_highlight.js index c6b77e43bcd..0dd18405e86 100644 --- a/app/assets/javascripts/feature_highlight/feature_highlight.js +++ b/app/assets/javascripts/feature_highlight/feature_highlight.js @@ -32,7 +32,7 @@ export const dismiss = function dismiss(cookieId) { }; export const mouseleave = function mouseleave() { - if (!document.querySelector('.popover:hover')) { + if (!$('.popover:hover').length > 0) { const $featureHighlight = $(this); hidePopover.call($featureHighlight); } @@ -43,8 +43,8 @@ export const mouseenter = function mouseenter() { const showedPopover = showPopover.call($featureHighlight); if (showedPopover) { - document.querySelector('.popover') - .addEventListener('mouseleave', mouseleave.bind($featureHighlight)); + $('.popover') + .on('mouseleave', mouseleave.bind($featureHighlight)); } }; @@ -53,6 +53,6 @@ export const setupDismissButton = function setupDismissButton() { const cookieId = this.dataset.highlight; const $popover = $(this); - document.querySelector(`#${popoverId} .dismiss-feature-highlight`) - .addEventListener('click', dismiss.bind($popover, cookieId)); + $(`#${popoverId} .dismiss-feature-highlight`) + .on('click', dismiss.bind($popover, cookieId)); }; |