diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-02-21 18:32:51 -0600 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-02-23 15:47:23 -0600 |
commit | 621bfdaa9f9abe977310fb2692a4194b5a87347c (patch) | |
tree | f169833861526b4ba2c49b53de1cdc61241b4100 /app/assets/javascripts/user_callout.js | |
parent | 46eefbda3ae55394bae63872c8ff3d86500a1ddc (diff) | |
download | gitlab-ce-621bfdaa9f9abe977310fb2692a4194b5a87347c.tar.gz |
Removed disabled rules from the user_callout_spec.js
Also changed the cookie sets to true and false values to make
it consistent with the rest of the javascript.
Fixed some haml and a missing new line
Diffstat (limited to 'app/assets/javascripts/user_callout.js')
-rw-r--r-- | app/assets/javascripts/user_callout.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/app/assets/javascripts/user_callout.js b/app/assets/javascripts/user_callout.js index 9aa565074e4..c10f0e8de5e 100644 --- a/app/assets/javascripts/user_callout.js +++ b/app/assets/javascripts/user_callout.js @@ -1,4 +1,4 @@ -/* eslint-disable arrow-parens, class-methods-use-this, no-param-reassign */ +/* eslint-disable class-methods-use-this */ /* global Cookies */ const userCalloutElementName = '.user-callout'; @@ -11,21 +11,20 @@ class UserCallout { constructor() { this.isCalloutDismissed = Cookies.get(USER_CALLOUT_COOKIE); this.init(); - this.isUserCalloutDismissed(); + this.toggleUserCallout(); } init() { $(document) - .on('click', closeButton, () => this.closeAndDismissCallout()) - .on('click', userCalloutBtn, () => this.closeAndDismissCallout()); + .on('click', closeButton, () => this.dismissCallout()) + .on('click', userCalloutBtn, () => this.dismissCallout()); } - closeAndDismissCallout() { - $(userCalloutElementName).hide(); - Cookies.set(USER_CALLOUT_COOKIE, '1'); + dismissCallout() { + Cookies.set(USER_CALLOUT_COOKIE, 'true'); } - isUserCalloutDismissed() { + toggleUserCallout() { if (!this.isCalloutDismissed) { $(userCalloutElementName).show(); } |