Commit 2034cec8 authored by Lukas Eipert's avatar Lukas Eipert Committed by Tim Zallmann

Support `js-close` as a removal class in UserCallout

parent f1a2ada1
...@@ -15,7 +15,7 @@ export default class UserCallout { ...@@ -15,7 +15,7 @@ export default class UserCallout {
init() { init() {
if (!this.isCalloutDismissed || this.isCalloutDismissed === 'false') { if (!this.isCalloutDismissed || this.isCalloutDismissed === 'false') {
$('.js-close-callout').on('click', e => this.dismissCallout(e)); this.userCalloutBody.find('.js-close-callout').on('click', e => this.dismissCallout(e));
} }
} }
...@@ -23,12 +23,15 @@ export default class UserCallout { ...@@ -23,12 +23,15 @@ export default class UserCallout {
const $currentTarget = $(e.currentTarget); const $currentTarget = $(e.currentTarget);
if (this.options.setCalloutPerProject) { if (this.options.setCalloutPerProject) {
Cookies.set(this.cookieName, 'true', { expires: 365, path: this.userCalloutBody.data('projectPath') }); Cookies.set(this.cookieName, 'true', {
expires: 365,
path: this.userCalloutBody.data('projectPath'),
});
} else { } else {
Cookies.set(this.cookieName, 'true', { expires: 365 }); Cookies.set(this.cookieName, 'true', { expires: 365 });
} }
if ($currentTarget.hasClass('close')) { if ($currentTarget.hasClass('close') || $currentTarget.hasClass('js-close')) {
this.userCalloutBody.remove(); this.userCalloutBody.remove();
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment