summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClement Ho <ClemMakesApps@gmail.com>2017-08-29 17:16:08 -0500
committerClement Ho <ClemMakesApps@gmail.com>2017-08-29 17:16:08 -0500
commit4ff3b6a978cb782ed2ac76ca0a33cf3192dc33a6 (patch)
treeb7090e50f5656bc96d7e9c843661c628e8c8d623
parent0f103693ffe4c0b7d6f4b5c8596fee13fbe1ea33 (diff)
downloadgitlab-ce-4ff3b6a978cb782ed2ac76ca0a33cf3192dc33a6.tar.gz
jQueryify feature_highlight file
-rw-r--r--app/assets/javascripts/feature_highlight/feature_highlight.js10
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));
};