summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/feature_highlight/feature_highlight_helper.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/feature_highlight/feature_highlight_helper.js')
-rw-r--r--app/assets/javascripts/feature_highlight/feature_highlight_helper.js28
1 files changed, 4 insertions, 24 deletions
diff --git a/app/assets/javascripts/feature_highlight/feature_highlight_helper.js b/app/assets/javascripts/feature_highlight/feature_highlight_helper.js
index fabc905d756..7b4bed69fb8 100644
--- a/app/assets/javascripts/feature_highlight/feature_highlight_helper.js
+++ b/app/assets/javascripts/feature_highlight/feature_highlight_helper.js
@@ -1,15 +1,12 @@
-import $ from 'jquery';
+import { deprecatedCreateFlash as Flash } from '~/flash';
import axios from '../lib/utils/axios_utils';
import { __ } from '../locale';
-import { deprecatedCreateFlash as Flash } from '../flash';
-import LazyLoader from '../lazy_loader';
-import { togglePopover } from '../shared/popover';
export const getSelector = (highlightId) => `.js-feature-highlight[data-highlight=${highlightId}]`;
-export function dismiss(highlightId) {
- axios
- .post(this.attr('data-dismiss-endpoint'), {
+export function dismiss(endpoint, highlightId) {
+ return axios
+ .post(endpoint, {
feature_name: highlightId,
})
.catch(() =>
@@ -19,21 +16,4 @@ export function dismiss(highlightId) {
),
),
);
-
- togglePopover.call(this, false);
- this.hide();
-}
-
-export function inserted() {
- const popoverId = this.getAttribute('aria-describedby');
- const highlightId = this.dataset.highlight;
- const $popover = $(this);
- const dismissWrapper = dismiss.bind($popover, highlightId);
-
- $(`#${popoverId} .dismiss-feature-highlight`).on('click', dismissWrapper);
-
- const lazyImg = $(`#${popoverId} .feature-highlight-illustration`)[0];
- if (lazyImg) {
- LazyLoader.loadImage(lazyImg);
- }
}